/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-input: #252833;
  --bg-hover: #2a2d3a;
  --border: #2e3140;
  --border-focus: #6366f1;
  --text: #e8eaf0;
  --text-muted: #8b8fa3;
  --text-dim: #5c6078;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-bg: rgba(99, 102, 241, 0.12);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --max-width: 1100px;
}

html, body {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* === Header === */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 24px 20px;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
/* === Header Nav Tabs === */
.header-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}

.nav-tab {
  padding: 5px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-tab:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-tab.active {
  background: var(--primary);
  color: #fff;
}

/* === Language Switcher === */
.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  flex-shrink: 0;
}

.lang-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--primary);
  color: #fff;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* === Main === */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h2 {
  margin-bottom: 0;
}

/* === Inputs === */
.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.input::placeholder {
  color: var(--text-dim);
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b8fa3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-text {
  background: transparent;
  color: var(--primary);
  padding: 4px 8px;
  font-size: 13px;
}
.btn-text:hover {
  background: var(--primary-bg);
}

.btn-search {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 8px;
}

/* === Spinner === */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === API Card === */
.api-key-row {
  display: flex;
  gap: 10px;
}

.api-key-row .input {
  flex: 1;
}

.api-key-row .btn {
  flex-shrink: 0;
}

.api-status {
  margin-top: 10px;
  font-size: 13px;
}

.api-status.success {
  color: var(--success);
}

.api-status.error {
  color: var(--danger);
}

.api-help {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.api-help ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.api-help strong {
  color: var(--text);
}

/* === Search Form === */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-group-half {
  flex: 1;
}

/* === Progress === */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
}

.progress-stats {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

/* === Results === */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-summary {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.results-actions {
  display: flex;
  gap: 8px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-bar .input {
  flex: 1;
}

.input-sort {
  max-width: 180px;
  flex: 0 0 auto !important;
}

/* === Results Table === */
.results-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

.results-table thead {
  background: var(--bg-input);
}

.results-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.results-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.results-table tbody tr:hover {
  background: var(--bg-hover);
}

.col-num {
  width: 40px;
  text-align: center !important;
}

.col-type {
  min-width: 100px;
  white-space: nowrap;
}

.col-name {
  min-width: 180px;
}

.col-address {
  min-width: 200px;
}

.col-phone {
  min-width: 130px;
  white-space: nowrap;
}

.col-rating {
  width: 80px;
  text-align: center !important;
}

.col-reviews {
  width: 80px;
  text-align: center !important;
}

.col-status {
  width: 120px;
}

.col-maps {
  width: 60px;
  text-align: center !important;
}

.td-center {
  text-align: center;
}

/* Star rating */
.stars {
  color: var(--warning);
  font-size: 12px;
  letter-spacing: 1px;
}

.star-half {
  display: inline-block;
  overflow: hidden;
  width: 0.5em;
}

.rating-num {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-no-site {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-has-site {
  background: var(--success-bg);
  color: var(--success);
}

/* Maps link */
.maps-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  color: var(--primary);
  transition: background 0.15s;
}

.maps-link:hover {
  background: var(--primary-bg);
  text-decoration: none;
}

/* No results */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.no-results p:first-child {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

/* === Detail Column === */
.col-details {
  width: 80px;
  text-align: center !important;
}

/* === View Button === */
.btn-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-view:hover {
  background: var(--primary);
  color: #fff;
}

/* === Save to DB Button === */
.btn-save-db {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-save-db:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.btn-save-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-save-row:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.btn-save-row:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.badge-saved {
  background: var(--success-bg);
  color: var(--success);
}

.col-save {
  width: 80px;
  text-align: center !important;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-address {
  font-size: 13px;
  color: var(--text-muted);
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.modal-meta .stars {
  font-size: 14px;
}

.meta-sep {
  color: var(--text-dim);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  overflow-y: auto;
  padding: 24px;
  flex: 1;
}

.modal-section {
  margin-bottom: 28px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* === Photo Gallery === */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-item {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.photo-item:hover img {
  transform: scale(1.05);
}

/* === Review Cards === */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.review-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.review-author strong {
  font-size: 13px;
  display: block;
}

.review-time {
  font-size: 11px;
  color: var(--text-dim);
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* === Sentiment Badges === */
.sentiment-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.sentiment-great {
  background: var(--success-bg);
  color: var(--success);
}

.sentiment-good {
  background: var(--primary-bg);
  color: var(--primary);
}

/* === Business Hours === */
.hours-list {
  list-style: none;
  padding: 0;
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.hours-list li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.hours-list li:last-child {
  border-bottom: none;
}

/* === Social Column (Table) === */
.col-social {
  width: 120px;
  text-align: center !important;
}

.social-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.social-cell-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.social-cell-icon:hover {
  background: var(--primary-bg);
  transform: scale(1.15);
  text-decoration: none;
}

.social-cell-icon svg {
  width: 16px;
  height: 16px;
}

.social-cell-more {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.social-cell-none {
  color: var(--text-dim);
  font-size: 12px;
}

.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* === Social Profiles === */
.social-profiles-loading {
  display: flex;
  justify-content: center;
  padding: 16px;
}

.social-save-prompt {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.social-profiles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.social-profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.15s;
}

.social-profile-item:hover {
  background: var(--bg-hover);
}

.social-profile-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.social-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.social-profile-info strong {
  font-size: 13px;
}

.social-profile-url {
  font-size: 12px;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-profile-handle {
  font-size: 11px;
  color: var(--text-dim);
}

.btn-social-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.btn-social-remove:hover {
  color: var(--danger);
}

.btn-social-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.social-no-profiles {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.social-add-form {
  margin-bottom: 16px;
}

.social-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.social-add-select {
  max-width: 180px;
  flex: 0 0 auto;
}

.social-add-input {
  flex: 1;
}

.social-add-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  font-size: 13px;
}

.social-search-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.social-search-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.social-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.social-search-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.social-search-link:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  text-decoration: none;
}

.social-search-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .header {
    padding: 16px;
  }

  .logo {
    font-size: 20px;
  }

  .main {
    padding: 16px;
  }

  .card {
    padding: 16px;
  }

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

  .api-key-row {
    flex-direction: column;
  }

  .results-header {
    flex-direction: column;
  }

  .filter-bar {
    flex-direction: column;
  }

  .input-sort {
    max-width: none;
  }

  .results-table {
    font-size: 12px;
  }

  .results-table th,
  .results-table td {
    padding: 8px 10px;
  }

  .col-address {
    min-width: 150px;
  }

  .social-add-row {
    flex-direction: column;
  }

  .social-add-select {
    max-width: none;
  }

  .social-search-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .results-actions {
    flex-direction: column;
    width: 100%;
  }

  .results-actions .btn {
    width: 100%;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-content {
    max-height: 90vh;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* === Toast Notifications === */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  max-width: 380px;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-warning {
  background: var(--warning);
  color: #1a1d27;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* === Enrichment UI === */

/* Business description */
.business-description-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* Features & amenities grid */
.features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-bg);
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.feature-tag-highlight {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.2);
}

.feature-tag-accessibility {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.2);
}

/* Research Report */
.report-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  color: var(--text-muted);
}
.report-loading p {
  font-size: 13px;
  text-align: center;
  max-width: 400px;
}
.report-section {
  margin-top: 16px;
}
.report-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.report-subsection {
  margin-top: 12px;
}
.report-subsection h5 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.report-blockquote {
  border-left: 3px solid var(--primary);
  padding: 8px 14px;
  margin: 8px 0;
  font-style: italic;
  color: var(--text-muted);
  background: var(--bg-input);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
  line-height: 1.6;
}
.report-warning-tag {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.2);
}
.report-section-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.report-section-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.report-section-item-header strong {
  font-size: 13px;
}
.report-section-item p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.badge-priority-high {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-priority-medium {
  background: var(--warning-bg);
  color: var(--warning);
}
.badge-priority-low {
  background: var(--primary-bg);
  color: var(--primary);
}
.report-raw-text p {
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.photo-plan-detail {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius);
  word-break: break-word;
}

/* Website Preview */
.website-preview-wrapper {
  margin-top: 16px;
}
.website-preview-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.website-preview-iframe {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
@media (max-width: 768px) {
  .website-preview-iframe {
    height: 350px;
  }
}

/* Review histogram */
.review-histogram {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 400px;
}

.histogram-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.histogram-star {
  font-size: 13px;
  font-weight: 600;
  color: var(--warning);
  width: 14px;
  text-align: center;
}

.histogram-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.histogram-bar-fill {
  height: 100%;
  background: var(--warning);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.histogram-count {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

/* Social profile card (Facebook/Instagram in modal) */
.social-profile-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.social-profile-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.social-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.social-profile-category {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.social-profile-followers {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
}

.social-profile-bio {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.social-profile-rating {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.social-cover-photo {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 8px;
}

/* Instagram posts grid */
.ig-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.ig-post-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
}

.ig-post-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.ig-post-item img:hover {
  transform: scale(1.05);
}

@media (max-width: 480px) {
  .ig-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Facebook reviews in modal */
.fb-reviews {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.fb-reviews h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.fb-reviews .review-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fb-reviews .review-item:last-child {
  border-bottom: none;
}
.fb-reviews .review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.fb-reviews .review-author-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.fb-reviews .review-author {
  font-size: 13px;
}
.fb-reviews .review-date {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}
.fb-reviews .review-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.fb-reactions {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  display: inline-block;
}

/* Social profile extra details */
.social-profile-address,
.social-profile-phone,
.social-profile-price {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}
.social-cover-photo {
  width: 100%;
  border-radius: var(--radius);
  margin-top: 10px;
  max-height: 200px;
  object-fit: cover;
}

/* Instagram stats row */
.ig-stats {
  display: flex;
  gap: 16px;
  margin: 8px 0;
}
.ig-stat {
  font-size: 13px;
  color: var(--text-muted);
}
.ig-stat strong {
  color: var(--text);
}

/* Instagram verified badge */
.ig-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Instagram bio links */
.ig-bio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.ig-bio-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  background: var(--primary-bg);
  padding: 3px 10px;
  border-radius: 20px;
}
.ig-bio-link:hover {
  text-decoration: underline;
}

/* Instagram post like overlay */
.ig-post-item {
  position: relative;
}
.ig-post-likes {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* Social profile name (secondary line) */
.social-profile-name {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

/* === Operator Admin === */
.admin-stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.admin-stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.admin-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}
.admin-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.admin-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-page-info {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 100px;
  text-align: center;
}
.btn-sm {
  padding: 5px 14px;
  font-size: 12px;
}

@media (max-width: 768px) {
  .admin-stats-bar {
    flex-wrap: wrap;
  }
  .admin-stat-card {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  .admin-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .admin-stat-card {
    flex: 1 1 100%;
  }
  .admin-filter-grid {
    grid-template-columns: 1fr;
  }
  .admin-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* === Enrichment Modal === */
.enrichment-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.enrichment-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg-input);
  transition: background 0.15s, opacity 0.15s;
}

.enrichment-step[data-status="active"] {
  background: var(--primary-bg);
  border: 1px solid var(--primary);
}

.enrichment-step[data-status="done"] {
  opacity: 0.7;
}

.enrichment-step[data-status="skipped"] {
  opacity: 0.4;
}

.enrichment-step-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.enrichment-step[data-status="active"] .enrichment-step-icon {
  color: var(--primary);
}

.enrichment-step[data-status="done"] .enrichment-step-icon {
  color: var(--success);
}

.enrichment-step-label {
  font-size: 13px;
  color: var(--text);
}

.enrichment-step[data-status="pending"] .enrichment-step-label {
  color: var(--text-muted);
}

.enrichment-biz-progress {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 18px;
  margin-bottom: 4px;
}
