.strategies-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-5);
  height: calc(100vh - 100px);
  align-items: start;
}

.strategies-sidebar {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.strategies-sidebar > .btn-primary {
  align-self: stretch;
  background: var(--status-success);
  border-color: var(--status-success);
  color: #0a0e14;
  font-weight: 600;
}

.strategy-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
  flex: 1;
}

.strategy-list-item {
  position: relative;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.strategy-list-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border-default);
}

.strategy-list-item:hover {
  background: var(--bg-elev-3);
  border-color: var(--border-strong);
}

.strategy-list-item.active {
  background: var(--bg-elev-3);
  border-color: var(--accent-cyan);
}

.strategy-list-item.active::before {
  background: var(--accent-cyan);
}

.strategy-list-item.shared::before {
  background: var(--accent-magenta);
}

.strategy-list-item-main {
  flex: 1;
  padding: var(--space-3);
  min-width: 0;
}

.strategy-list-item .strategy-name {
  color: var(--fg-primary);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-list-item .strategy-meta {
  color: var(--fg-tertiary);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
}

.strategy-list-item.active .strategy-meta {
  color: var(--accent-cyan);
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
}

.status-dot-active {
  color: var(--bull);
  text-shadow: 0 0 4px rgba(74, 222, 128, 0.6);
}

.status-dot-inactive {
  color: var(--bear);
}

.status-text {
  font-weight: 600;
  letter-spacing: 0.05em;
}

.status-active {
  color: var(--bull);
}

.status-inactive {
  color: var(--bear);
}

.strategy-version {
  color: var(--fg-tertiary);
  font-weight: 400;
}

.strategy-delete-btn {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border-subtle);
  color: var(--fg-tertiary);
  padding: 0 var(--space-3);
  cursor: pointer;
  font-size: 16px;
  opacity: 0.5;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.strategy-list-item:hover .strategy-delete-btn {
  opacity: 1;
}

.strategy-delete-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--bear);
  opacity: 1;
}

.strategy-editor {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.editor-metadata {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.editor-metadata input,
.editor-metadata textarea {
  flex: 1;
  background: var(--bg-input);
  color: var(--fg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  resize: vertical;
}

.editor-metadata input:focus,
.editor-metadata textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.sections-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.section {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.section::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.15s;
}

.section:hover {
  border-color: var(--border-default);
}

.section[data-active="true"] {
  border-color: rgba(86, 216, 224, 0.3);
}

.section[data-active="true"]::before {
  background: var(--accent-cyan);
}

.section[data-collapsed="false"] {
  border-color: var(--border-default);
}

.section[data-collapsed="false"][data-active="true"] {
  border-color: rgba(86, 216, 224, 0.5);
  box-shadow: 0 0 0 1px rgba(86, 216, 224, 0.1);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  padding: 0;
  width: 100%;
}

.section-header-click {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  min-width: 0;
}

.section-header-click:hover {
  background: var(--bg-elev-3);
}

.chevron {
  color: var(--fg-tertiary);
  font-size: 11px;
  width: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, color 0.15s;
  flex-shrink: 0;
}

.section[data-collapsed="false"] .chevron {
  color: var(--accent-cyan);
}

.section-number {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--fg-tertiary);
  letter-spacing: 0.04em;
  min-width: 28px;
  text-align: center;
  background: var(--bg-elev-3);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.section[data-active="true"] .section-number {
  background: rgba(86, 216, 224, 0.15);
  color: var(--accent-cyan);
}

.section-title {
  color: var(--fg-secondary);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

.section[data-active="true"] .section-title {
  color: var(--fg-primary);
}

.section-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--fg-disabled);
  font-size: 0;
  flex-shrink: 0;
  transition: all 0.15s;
}

.section[data-active="true"] .section-status {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(86, 216, 224, 0.5);
}

.section[data-warning="true"] .section-status {
  background: var(--status-warning);
  border-color: var(--status-warning);
  box-shadow: 0 0 6px rgba(255, 181, 71, 0.4);
}

.section-summary {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: var(--space-2);
  opacity: 0.7;
  letter-spacing: 0.02em;
}

.section[data-active="true"] .section-summary {
  color: var(--fg-secondary);
  opacity: 1;
}

.section[data-collapsed="false"] .section-summary {
  opacity: 0.5;
}

.section-summary:empty {
  display: none;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding-right: var(--space-3);
  flex-shrink: 0;
}

.btn-toggle {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-cyan);
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--fg-tertiary);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s;
}

.btn-reset:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(86, 216, 224, 0.08);
}

.section-panel {
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elev-1);
  animation: section-expand 0.2s ease;
}

@keyframes section-expand {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3) var(--space-4);
}

.section-fields .field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
}

.section-fields .field label {
  color: var(--fg-tertiary);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-fields .field input[type="text"],
.section-fields .field input[type="number"],
.section-fields .field select,
.section-fields .field textarea {
  background: var(--bg-input);
  color: var(--fg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  min-height: 32px;
}

.section-fields .field input:focus,
.section-fields .field select:focus,
.section-fields .field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px rgba(74, 143, 231, 0.2);
}

.section-fields .field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
}

.section-fields .field-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent-cyan);
  width: 14px;
  height: 14px;
}

.section-fields .field-checkbox label {
  text-transform: none;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--fg-secondary);
  letter-spacing: 0;
  cursor: pointer;
}

.section-fields .field-multi-check {
  grid-column: 1 / -1;
}

.section-fields .field-multi-check label {
  margin-bottom: var(--space-2);
}

.section-fields .multi-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.section-fields .multi-check-list label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: all 0.15s;
}

.section-fields .multi-check-list label:hover {
  background: var(--bg-elev-3);
  border-color: var(--border-strong);
}

.section-fields .multi-check-list input[type="checkbox"]:checked + span,
.section-fields .multi-check-list label:has(input:checked) {
  background: rgba(86, 216, 224, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.editor-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.editor-actions button {
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  .strategies-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .strategies-sidebar {
    height: auto;
    max-height: 300px;
  }
  .strategy-editor {
    height: auto;
  }
}

.searchable-select-container {
    position: relative;
    width: 100%;
}

.searchable-select-input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    color: var(--text-primary, #fff);
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.searchable-select-input:focus {
    outline: none;
    border-color: var(--accent-blue, #4a90e2);
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.searchable-select-item {
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color-light, rgba(255, 255, 255, 0.05));
}

.searchable-select-item:last-child {
    border-bottom: none;
}

.searchable-select-item:hover {
    background: var(--bg-hover, #2a2a2a);
}

.searchable-select-empty {
    padding: 10px;
    color: var(--text-muted, #888);
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
}

.section.expanded,
.section .field-wrap,
.section .section-body,
.section .section-content {
    overflow: visible !important;
}

.searchable-select-container {
    z-index: 100;
}

.searchable-select-dropdown {
    z-index: 9999;
}

.section,
.section .field,
.section .fields,
.section .field-wrap,
.section .section-body,
.section .section-content {
    overflow: visible !important;
}

.searchable-select-container {
    position: relative;
    z-index: 100;
}

.searchable-select-dropdown {
    z-index: 9999;
}
