body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background: #0f172a;
  color: #e2e8f0;
}

header {
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
}

.tab-btn.active {
  border-color: #3b82f6;
  background: #1d4ed8;
}

.refresh-btn {
  margin-left: auto;
}

.tab-content {
  display: none;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.card,
.panel {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
}

.card .label {
  font-size: 12px;
  color: #94a3b8;
}

.card .value {
  font-size: 22px;
  font-weight: 700;
}

form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

input,
select,
button {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
}

button {
  cursor: pointer;
}

.checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #334155;
  padding: 8px;
  text-align: left;
  font-size: 13px;
}

.pager {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.hint {
  color: #94a3b8;
  font-size: 12px;
}

.json-box {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 10px;
  overflow: auto;
  max-height: 300px;
  white-space: pre-wrap;
  word-break: break-word;
}

a {
  color: #60a5fa;
}

.progress-indicator {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(90deg, #1e293b 0%, #1e3a8a 100%);
  border: 1px solid #3b82f6;
  border-radius: 8px;
  margin-bottom: 12px;
}

.progress-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #1e293b;
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

.progress-text {
  flex: 1;
}

#valuation-progress-status {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.3s ease;
}

.progress-elapsed {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

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

.valuation-recommendation {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  border: 2px solid #10b981;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.valuation-recommendation h2,
.valuation-recommendation h3 {
  color: #6ee7b7;
  margin: 0 0 12px 0;
  font-size: 18px;
  border-bottom: 1px solid #047857;
  padding-bottom: 8px;
}

.valuation-recommendation ul {
  margin: 0;
  padding-left: 20px;
}

.valuation-recommendation li {
  margin: 6px 0;
  color: #ecfdf5;
  font-size: 15px;
}

.valuation-recommendation strong {
  color: #fef3c7;
}

.valuation-recommendation p {
  color: #ecfdf5;
  margin: 6px 0;
}

.decision-banner {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 6px solid #10b981;
  background: rgba(0, 0, 0, 0.15);
}

.decision-banner.decision-buy { border-left-color: #10b981; }
.decision-banner.decision-negotiate { border-left-color: #f59e0b; }
.decision-banner.decision-warn { border-left-color: #f97316; }
.decision-banner.decision-reject { border-left-color: #ef4444; }
.decision-banner.decision-default { border-left-color: #6b7280; }

.decision-status {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.decision-prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 18px;
  margin-bottom: 10px;
}

.decision-prices div {
  color: #ecfdf5;
  font-size: 15px;
}

.decision-prices span {
  color: #a7f3d0;
}

.decision-prices strong {
  color: #fef3c7;
  font-size: 17px;
  font-weight: 700;
}

.decision-risks, .decision-checks {
  margin-top: 8px;
  color: #ecfdf5;
}

.decision-risks ul, .decision-checks ul {
  margin: 4px 0 0 0;
  padding-left: 18px;
}

.markdown-body {
  line-height: 1.6;
  word-break: break-word;
}

.markdown-body h1 {
  font-size: 22px;
  margin: 20px 0 12px 0;
  border-bottom: 1px solid #334155;
  padding-bottom: 6px;
}

.markdown-body h2 {
  font-size: 19px;
  margin: 18px 0 10px 0;
  color: #60a5fa;
}

.markdown-body h3 {
  font-size: 16px;
  margin: 14px 0 8px 0;
  color: #93c5fd;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 22px;
  margin: 8px 0;
}

.markdown-body li {
  margin: 4px 0;
}

.markdown-body p {
  margin: 8px 0;
}

.markdown-body strong {
  color: #fef3c7;
}

.markdown-body code {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
  color: #fbbf24;
}

.markdown-body table.md-table {
  border-collapse: collapse;
  margin: 12px 0;
  width: auto;
  min-width: 50%;
  background: #0b1220;
  border-radius: 6px;
  overflow: hidden;
}

.markdown-body table.md-table th,
.markdown-body table.md-table td {
  border: 1px solid #334155;
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
}

.markdown-body table.md-table th {
  background: #1e293b;
  color: #93c5fd;
  font-weight: 600;
}

.markdown-body table.md-table tr:nth-child(even) td {
  background: #111827;
}

details > summary {
  cursor: pointer;
  color: #94a3b8;
  margin-top: 12px;
}

/* Обзор парсинга по источникам (вкладка «Техническое») */
.src-table {
  font-size: 13px;
}
.src-table th,
.src-table td {
  vertical-align: top;
}
.src-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.src-sub {
  color: #94a3b8;
  font-size: 12px;
}
.src-mode {
  color: #cbd5e1;
}
.src-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.src-on {
  background: #064e3b;
  color: #6ee7b7;
}
.src-off {
  background: #3f1d1d;
  color: #fca5a5;
}
.src-na {
  background: #1e293b;
  color: #94a3b8;
}
.src-stale {
  color: #fbbf24;
  font-weight: 600;
}
