:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.container {
  width: min(1500px, calc(100% - 32px));
  margin: 32px auto;
}

header {
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 4px;
}

header p {
  margin: 0;
  color: #6b7280;
}

.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 600;
}

label span {
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
  outline: none;
}

input:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, .12);
}

.autocomplete {
  position: relative;
}

.suggestions {
  display: none;
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 3px;
  max-height: 240px;
  overflow-y: auto;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.suggestions.visible {
  display: block;
}

.suggestion {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: white;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.suggestion:hover {
  background: #f3f4f6;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}

#searchButton {
  background: #111827;
  color: white;
}

#searchButton:disabled {
  opacity: .6;
  cursor: wait;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

.message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 7px;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
}

.message.success {
  background: #dcfce7;
  color: #166534;
}

.hidden {
  display: none !important;
}

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

.results-header h2 {
  margin: 0 0 3px;
}

#resultInfo {
  color: #6b7280;
  font-size: 14px;
}

.loading {
  color: #6b7280;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
}

th {
  background: #f9fafb;
  font-weight: 700;
  position: sticky;
  top: 0;
}

tbody tr:hover {
  background: #f9fafb;
}

.empty {
  padding: 35px;
  text-align: center;
  color: #6b7280;
}

.error-text {
  color: #991b1b;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.pagination button {
  background: #e5e7eb;
}

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

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 20px, 1500px);
    margin: 15px auto;
  }

  .card {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
