* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #111827;
  color: #e5e7eb;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
  gap: 16px;
  padding: 16px;
}

.card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.main {
  display: grid;
  grid-template-rows: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 16px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.field input,
.field select,
textarea {
  width: 100%;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #0f172a;
  color: #f9fafb;
  padding: 10px 12px;
  font-size: 14px;
}

textarea {
  min-height: 520px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  background: #374151;
  color: #fff;
}

button.primary {
  background: #2563eb;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.secondary {
  background: #475569;
}

.button-group {
  display: grid;
  gap: 8px;
}

.status-panel {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #374151;
  font-size: 13px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid #374151;
  padding-bottom: 10px;
}

.tab {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}

.tab:hover {
  color: #e5e7eb;
  background: #1f2937;
}

.tab.active {
  background: #2563eb;
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Human-friendly data form */
.data-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.form-section {
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 12px 14px;
  background: #0f172a;
  font-weight: 600;
  font-size: 14px;
  color: #93c5fd;
  display: grid;
  gap: 8px;
}

.form-section > .form-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #1e293b;
}

.form-row:last-child {
  border-bottom: 0;
}

.form-label {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 500;
  word-break: break-word;
  line-height: 1.4;
}

.form-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.form-control input[type='text'],
.form-control input[type='number'],
.form-control select {
  width: 100%;
  min-width: 0;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  padding: 8px 10px;
  font-size: 13px;
}

.form-control input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

.form-hint {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.form-row-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.form-row-inline input[type='text'],
.form-row-inline input[type='number'] {
  flex: 1;
  min-width: 120px;
}

.form-row-inline select {
  flex: 0 0 auto;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.form-actions button {
  min-width: 120px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-header h2,
h1 {
  margin: 0;
}

.muted {
  color: #94a3b8;
}

.console,
.report {
  margin: 0;
  min-height: 360px;
  max-height: 420px;
  overflow: auto;
  background: #0b1220;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

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