* { box-sizing: border-box; }

:root{
  --bg:#f5f7fb;
  --panel:#ffffff;
  --border:#dbe2ea;
  --text:#1f2937;
  --muted:#64748b;
  --accent:#2563eb;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

code {
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px 6px;
}

.app-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px;
}

.app-header {
  background: var(--panel);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.app-header h1 {
  margin: 0 0 8px 0;
}

.app-header p {
  margin: 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.slim-toolbar{
  margin-bottom: 12px;
}

.toolbar button {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
}

.toolbar button:hover,
.table-actions button:hover,
.candidate-item-actions button:hover {
  border-color: #94a3b8;
}

.app-main {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 16px;
}

.input-column,
.output-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.panel h2 {
  margin-top: 0;
  font-size: 18px;
}

label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

input:disabled,
select:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.table-actions button {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
}

.helper-text {
  margin-top: 10px;
  font-size: 13px;
  color: #475569;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.summary-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.summary-card .label {
  font-size: 13px;
  color: #475569;
}

.summary-card .value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 6px;
}

.decision-badge {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 10px;
}

.decision-neutral { background: #e5e7eb; color: #111827; }
.decision-accepted { background: #dcfce7; color: #166534; }
.decision-caution { background: #fef3c7; color: #92400e; }
.decision-reject { background: #fee2e2; color: #991b1b; }

.decision-summary-text ul,
#decisionSummary ul {
  margin: 10px 0 0 18px;
  padding: 0;
}

.status-pass { font-weight: 700; color: #166534; }
.status-fail { font-weight: 700; color: #991b1b; }
.status-na { font-weight: 700; color: #6b7280; }

.plot-box {
  width: 100%;
  min-height: 420px;
}

#plotMultiPumpOverlay {
  min-height: 460px;
}

.candidate-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.candidate-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.candidate-item.active {
  border-color: #3b82f6;
  background: #eff6ff;
}

.candidate-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.candidate-item-title {
  font-weight: 700;
  font-size: 14px;
}

.candidate-item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.candidate-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.candidate-item-actions button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
}

.active-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
}

#candidateComparisonTable td:last-child,
#candidateComparisonTable th:last-child {
  min-width: 260px;
}

@media (max-width: 1180px) {
  .app-main {
    grid-template-columns: 1fr;
  }
  .app-header{
    flex-direction: column;
  }
}
