/* Grey Wolf CSD Connector Tester — matches SyteLine tester exactly */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

header {
  background: #1a1a2e;
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

header .brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: .5;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
}

header .erp {
  margin-left: auto;
  background: #e63946;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

.container {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px;
}

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  background: #1a1a2e;
  color: #fff;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-body {
  padding: 20px;
}

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.field {
  flex: 1;
  min-width: 180px;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.field select,
.field input[type=text] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #1a1a2e;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}

.field select:focus,
.field input[type=text]:focus {
  outline: none;
  border-color: #e63946;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.params-grid .field label { color: #444; }

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  padding: 9px 22px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

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

.btn-secondary { background: #eee; color: #333; }
.btn-secondary:hover:not(:disabled) { background: #ddd; }

.status-bar {
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  margin-left: auto;
}
.status-bar.visible { display: flex; }

.badge { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.badge-ok  { background: #d1fae5; color: #065f46; }
.badge-err { background: #fee2e2; color: #991b1b; }
.badge-time { background: #e0e7ff; color: #3730a3; }

#result-card { display: none; }
#result-card.visible { display: block; }

.result-title {
  padding: 14px 20px 0;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
}

.result-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  padding: 0 20px;
  margin-top: 10px;
}

.result-tab {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.result-tab.active { color: #e63946; border-bottom-color: #e63946; }

.result-panel { display: none; padding: 16px 20px; }
.result-panel.active { display: block; }

.fv-table { width: 100%; border-collapse: collapse; }
.fv-sub-table { border-collapse: collapse; font-size: 12px; margin: 2px 0; }
.fv-sub-table th { background: #e0e7ff; color: #3730a3; padding: 3px 8px; text-align: left; font-weight: 600; border: 1px solid #c7d2fe; }
.fv-sub-table td { padding: 3px 8px; border: 1px solid #e5e7eb; color: #166534; }
.fv-table tr:nth-child(even) td { background: #fafafa; }
.fv-table td { padding: 5px 10px; font-size: 13px; vertical-align: top; border-bottom: 1px solid #f0f0f0; }
.fv-table td.fv-name { font-weight: 600; color: #3730a3; text-align: right; white-space: nowrap; width: 220px; background: #eef2ff; }
.fv-table td.fv-val { color: #166534; word-break: break-all; }
.fv-table td.fv-val.fv-empty { color: #bbb; font-style: italic; }
.fv-table td.fv-val.fv-num { color: #92400e; }

.xml-bracket { color: #6b7280; }
.xml-tag { color: #4361ee; font-weight: 600; }
.xml-attr { color: #7c3aed; }
.xml-value { color: #166534; }
.xml-decl { color: #9ca3af; font-style: italic; }

.fv-record-sep {
  font-size: 11px; font-weight: 700; color: #e63946; text-transform: uppercase;
  letter-spacing: 1px; padding: 10px 0 4px; border-bottom: 2px solid #e63946;
  margin-bottom: 6px; margin-top: 14px;
}
.fv-record-sep:first-child { margin-top: 0; }
.fv-count { font-size: 12px; color: #888; margin-bottom: 12px; }

pre {
  background: #1a1a2e; color: #e2e8f0; padding: 16px; border-radius: 6px;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px; line-height: 1.6; overflow-x: auto;
  white-space: pre-wrap; word-break: break-all;
}

.spinner {
  display: none; width: 16px; height: 16px;
  border: 2px solid #eee; border-top-color: #e63946;
  border-radius: 50%; animation: spin .6s linear infinite;
}
.spinner.visible { display: inline-block; }

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

#params-placeholder { color: #bbb; font-size: 13px; font-style: italic; padding: 8px 0; }
