* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  padding: 2rem;
  background: #f5f5f5;
  color: #333;
}
h1 {
  margin-bottom: 0.5rem;
}
#subtitle {
  margin-bottom: 1.5rem;
  color: #666;
  font-size: 0.95rem;
}

/* Config panel */
.config-panel {
  background: #fff;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.config-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.config-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.config-field select,
.config-field input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  min-width: 100px;
}
.config-field input:focus,
.config-field select:focus {
  outline: none;
  border-color: #3730a3;
  box-shadow: 0 0 0 2px rgba(55, 48, 163, 0.15);
}
#inputWrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}
#inputWrapper input {
  width: 100%;
}
#cityDropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
#cityDropdown.open {
  display: block;
}
#cityDropdown .city-option {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.88rem;
}
#cityDropdown .city-option:hover {
  background: #e0e7ff;
}
#cityDropdown .city-option .city-ars {
  color: #888;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}
#cityDropdown .no-results {
  padding: 0.4rem 0.6rem;
  color: #888;
  font-style: italic;
  font-size: 0.88rem;
}
#validateBtn {
  padding: 0.45rem 1.5rem;
  background: #3730a3;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
#validateBtn:hover {
  background: #312e81;
}
#validateBtn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

/* Status & results */
#status {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
  background: #e0e0e0;
  color: #555;
}
#status.loading {
  background: #dbeafe;
  color: #1e40af;
}
#status.error {
  background: #fee2e2;
  color: #991b1b;
}
#status.success {
  background: #dcfce7;
  color: #166534;
}
.summary {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.summary-item {
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9rem;
}
.summary-ok {
  background: #dcfce7;
  color: #166534;
}
.summary-warn {
  background: #fef3c7;
  color: #92400e;
}
.summary-error {
  background: #fee2e2;
  color: #991b1b;
}
.summary-info {
  background: #dbeafe;
  color: #1e40af;
}
.summary-no-schema {
  background: #f3f4f6;
  color: #555;
}
.group-header {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.95rem;
}
.group-validated {
  background: #e0e7ff;
  color: #3730a3;
}
.group-no-schema {
  background: #fef3c7;
  color: #92400e;
}
.group-missing {
  background: #fee2e2;
  color: #991b1b;
}
.group-unused {
  background: #f3f4f6;
  color: #555;
}
a {
  color: #2156a5;
  text-decoration: underline;
  line-height: inherit;
}
a:hover,
a:focus {
  color: #1d4b8f;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}
th {
  background: #333;
  color: #fff;
  text-align: left;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}
th:hover {
  background: #555;
}
th .sort-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  opacity: 0.4;
}
th.sorted-asc .sort-arrow,
th.sorted-desc .sort-arrow {
  opacity: 1;
}
td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
tr:last-child td {
  border-bottom: none;
}
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: bold;
}
.badge-NONE {
  background: #dcfce7;
  color: #166534;
}
.badge-WARN {
  background: #fef3c7;
  color: #92400e;
}
.badge-ERROR {
  background: #fee2e2;
  color: #991b1b;
}
.badge-INFO {
  background: #dbeafe;
  color: #1e40af;
}
.value-cell {
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.value-cell:hover {
  white-space: normal;
  overflow: visible;
}
.msg-cell {
  white-space: pre-wrap;
  max-width: 450px;
  font-size: 0.85rem;
  color: #666;
}
.msg-error {
  color: #991b1b;
  font-weight: bold;
}
.msg-warn {
  color: #92400e;
}

/* Selection overlay */
#selectionOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 15vh;
}
#selectionOverlay.open {
  display: flex;
}
#selectionBox {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
#selectionBox h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.05rem;
}
#selectionBox p {
  margin: 0 0 1rem 0;
  color: #666;
  font-size: 0.88rem;
}
#selectionList {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
}
#selectionList li {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
#selectionList li:last-child {
  border-bottom: none;
}
#selectionList li:hover {
  background: #e0e7ff;
}
#selectionList .sel-title {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
}
#selectionList .sel-sub {
  font-size: 0.78rem;
  color: #888;
  display: block;
  margin-top: 1px;
}
#selectionList .sel-invalid {
  text-decoration: line-through;
  color: #999;
}
#selectionList .sel-invalid .sel-sub {
  color: #bbb;
}

/* Direktlink */
#direct-link {
  font-size: 0.85rem;
  word-break: break-all;
  background-color: #dee;
  margin-bottom: 1rem;
  padding: 0.75rem;
}
.direct-link-label {
  font-weight: 600;
  color: #555;
  margin-right: 0.25rem;
}
.direct-link {
  color: #2156a5;
  text-decoration: underline;
}
.direct-link:hover {
  color: #1d4b8f;
}
