:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f2f4f7;
  color: #0f172a;
}

body {
  margin: 0;
}

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  margin-bottom: 1.5rem;
}

h1,
h2 {
  margin-top: 0;
}

form,
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.file-input {
  border: 2px dashed #cbd5f5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
}

.file-input input {
  display: none;
}

button {
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
}

button:hover {
  background-color: #1d4ed8;
}

.ghost {
  background: transparent;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.ghost:hover {
  background: #e0ecff;
}

#search-input {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.status {
  margin: 0.25rem 0;
}

.muted {
  color: #64748b;
  font-size: 0.9rem;
}

.results-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.copy-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.comment-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 250px;
  min-width: 220px;
}

.comment-group label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.comment-group textarea {
  border: 1px solid #cbd5f5;
  border-radius: 8px;
  padding: 0.5rem;
  font-family: inherit;
  resize: vertical;
}

.copy-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
}

.spinner::after {
  content: "";
  width: 36px;
  height: 36px;
  border: 4px solid #cbd5f5;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.hidden {
  display: none;
}

tbody tr.highlight {
  animation: pulse 1.5s ease;
  background: #dbeafe;
}

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

@keyframes pulse {
  0% {
    background: #dbeafe;
  }
  100% {
    background: transparent;
  }
}

.top-nav {
  background: white;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
}

.top-nav a {
  color: #2563eb;
  text-decoration: none;
  margin-right: 1.5rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.top-nav a:hover {
  background-color: #eff6ff;
}

.color-buttons {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.color-btn {
  width: 24px;
  height: 24px;
  border: 2px solid #cbd5f5;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, border-color 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
  border-color: #2563eb;
}

.color-btn.clear-highlight {
  background: white;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-btn.clear-highlight:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.delete-btn {
  background-color: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s, transform 0.1s;
}

.delete-btn:hover {
  background-color: #b91c1c;
  transform: scale(1.05);
}

.delete-btn:active {
  transform: scale(0.98);
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
}

.bulk-actions button {
  margin: 0;
}

.business-checkbox,
#select-all-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

tbody tr.highlight-yellow {
  background-color: #fef3c7 !important;
}

tbody tr.highlight-green {
  background-color: #d1fae5 !important;
}

tbody tr.highlight-blue {
  background-color: #dbeafe !important;
}

tbody tr.highlight-pink {
  background-color: #fce7f3 !important;
}

tbody tr.highlight-orange {
  background-color: #fed7aa !important;
}

tbody tr.highlight-purple {
  background-color: #e9d5ff !important;
}

@media (max-width: 640px) {
  button,
  .file-input {
    width: 100%;
  }

  .results-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .color-buttons {
    flex-wrap: wrap;
  }
}
