/* Панель «Тест стратегий» — дополнения к trading.css */

.testing-page {
  --testing-accent: #5b8def;
}

.testing-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.testing-main:has(#testing-panel-simulations.is-active) {
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100vh - 40px);
  overflow: hidden;
}

.testing-panel--wide {
  max-width: none;
}

.testing-panel--wide.is-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.testing-page .testing-panel--wide .trade-deals {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.trade-deals-table tr.is-selected td {
  background: rgba(91, 141, 239, 0.12);
}

.trade-deals-table td.is-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted, #9aa3b2);
}

.trade-deals__status.is-error {
  color: #ef5350;
}

.testing-topbar__actions {
  gap: 16px;
}

.testing-project-badge {
  font-size: 12px;
  color: rgba(231, 234, 240, 0.75);
  white-space: nowrap;
}

.testing-panel {
  display: none;
}

.testing-panel.is-active {
  display: block;
}

.testing-placeholder {
  padding: 32px 28px;
  border: 1px solid var(--border, #232833);
  border-radius: 8px;
  background: var(--surface, #161a22);
}

.testing-placeholder__title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
  color: var(--text, #e7eaf0);
}

.testing-placeholder__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted, #9aa3b2);
}

.testing-placeholder__text strong {
  color: var(--testing-accent, #5b8def);
  font-weight: 600;
}

.trade-modal--wide {
  width: min(560px, 100%);
}

.testing-sim-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.testing-sim-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.testing-sim-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.testing-sim-field--inline {
  margin-top: 8px;
}

.testing-sim-field__label {
  font-size: 12px;
  color: var(--muted, #9aa3b2);
}

.testing-sim-field input[type='text'],
.testing-sim-field input[type='number'],
.testing-sim-field input[type='date'],
.testing-sim-field select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border, #232833);
  border-radius: 4px;
  background: var(--bg, #0f1218);
  color: var(--text, #e7eaf0);
  font: inherit;
  font-size: 13px;
}

.testing-sim-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 13px;
}

.testing-sim-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.testing-sim-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.testing-sim-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.testing-panel--results {
  max-width: none;
}

.testing-main:has(#testing-panel-results.is-active) {
  max-width: 1400px;
}

.testing-results {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.testing-results-block {
  border: 1px solid var(--border, #232833);
  border-radius: 8px;
  background: var(--surface, #161a22);
  padding: 20px 22px 24px;
}

.testing-results-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.testing-results-block__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #e7eaf0);
}

.testing-results-subtitle {
  margin: 20px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted, #9aa3b2);
}

.testing-results-subtitle:first-of-type {
  margin-top: 0;
}

.testing-results-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted, #9aa3b2);
}

.testing-results-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted, #9aa3b2);
}

.testing-results-status.is-error {
  color: #ef5350;
}

.testing-results-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #9aa3b2);
}

.testing-results-sim-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.testing-results-sim-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #232833);
  border-radius: 6px;
  background: var(--bg, #0f1218);
  cursor: pointer;
  font-size: 13px;
}

.testing-results-sim-item:hover {
  border-color: rgba(91, 141, 239, 0.45);
}

.testing-results-sim-item input {
  margin-top: 3px;
  flex-shrink: 0;
}

.testing-results-sim-item__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.testing-results-sim-item__name {
  font-weight: 600;
  color: var(--text, #e7eaf0);
  word-break: break-word;
}

.testing-results-sim-item__stats {
  color: var(--muted, #9aa3b2);
  font-size: 12px;
}

.testing-results-table-wrap {
  overflow: auto;
  border: 1px solid var(--border, #232833);
  border-radius: 6px;
}

.testing-results-table-wrap--wide {
  max-height: 480px;
}

.testing-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.testing-results-table th,
.testing-results-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border, #232833);
  text-align: right;
  white-space: nowrap;
}

.testing-results-table th:first-child,
.testing-results-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface, #161a22);
}

.testing-results-table thead th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #9aa3b2);
  font-weight: 600;
}

.testing-results-th-label {
  text-align: left !important;
  color: var(--muted, #9aa3b2) !important;
  font-weight: 500 !important;
}

.testing-results-th-group {
  text-align: center !important;
  color: var(--testing-accent, #5b8def) !important;
  border-left: 1px solid var(--border, #232833);
}

.testing-results-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.testing-results-table tbody tr:hover td:first-child {
  background: #181c24;
}

.testing-results-table td.is-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted, #9aa3b2);
}

.testing-results-details-row--sym-start td:first-child {
  font-weight: 600;
  color: var(--testing-accent, #5b8def);
}
