/* ============================================
   workspace.css — Workspace-specific styles
   ============================================ */

/* ===== Section & Header ===== */
.ws-section {
  max-width: 960px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 24px) 24px 48px;
  animation: fadeIn 0.3s ease;
}

.ws-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}

.ws-header-left h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.ws-header-left p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.ws-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid var(--accent-purple);
  background: rgba(188, 140, 255, 0.12);
  color: var(--accent-purple);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-create-btn:hover {
  background: rgba(188, 140, 255, 0.25);
}

/* ===== Filters ===== */
.ws-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.ws-filter-btn {
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-filter-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.ws-filter-btn.active {
  background: rgba(188, 140, 255, 0.15);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

/* ===== Workspace Cards (list view) ===== */
.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.ws-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--card-radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ws-card:hover {
  border-color: var(--text-muted);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.ws-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ws-card-market {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-blue);
  font-family: var(--font-mono);
}

.ws-card-category {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent-blue);
}

.ws-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.ws-card-goal {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.5em;
}

.ws-card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ws-card-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.ws-card-progress-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 2px;
  transition: width var(--transition-normal);
}

.ws-card-progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ws-card-status-dots {
  display: flex;
  gap: 6px;
}

.ws-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
}

.ws-status-dot.confirmed {
  border-color: var(--accent-green);
  background: var(--accent-green);
}

.ws-status-dot.invalidated {
  border-color: var(--accent-red);
  background: var(--accent-red);
}

/* ===== Empty State ===== */
.ws-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-muted);
  text-align: center;
}

.ws-empty-state svg {
  opacity: 0.4;
}

.ws-empty-state p {
  font-size: 0.95rem;
  max-width: 400px;
}

/* ===== Workspace Detail ===== */
.ws-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.ws-detail-market {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ws-detail-market-id {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-blue);
  font-family: var(--font-mono);
}

.ws-detail-market-name {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.ws-detail-market-cat {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent-blue);
}

.ws-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ws-detail-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ws-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-delete-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(248, 81, 73, 0.08);
}

/* ===== Goal Section ===== */
.ws-detail-goal {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 28px;
}

.ws-detail-goal h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-goal-display {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  min-height: 2em;
}

.ws-goal-display:hover {
  border-color: var(--border-primary);
  background: var(--bg-tertiary);
}

.ws-goal-display.empty {
  color: var(--text-muted);
  font-style: italic;
}

.ws-goal-input {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.ws-goal-input:focus {
  border-color: var(--accent-blue);
}

.ws-goal-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ws-goal-save {
  padding: 5px 14px;
  border-radius: 5px;
  border: none;
  background: var(--accent-blue);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ws-goal-save:hover {
  background: #4090e0;
}

.ws-goal-cancel {
  padding: 5px 14px;
  border-radius: 5px;
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-goal-cancel:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ===== Timeline ===== */
.ws-timeline-section {
  margin-bottom: 28px;
}

.ws-timeline-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.ws-timeline {
  display: flex;
  flex-direction: column;
}

.ws-timeline-item {
  display: flex;
  position: relative;
}

.ws-timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
  padding-top: 18px;
}

.ws-timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  flex-shrink: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
}

.ws-timeline-dot.status-confirmed {
  border-color: var(--accent-green);
  background: var(--accent-green);
  color: #fff;
}

.ws-timeline-dot.status-invalidated {
  border-color: var(--accent-red);
  background: var(--accent-red);
  color: #fff;
}

.ws-timeline-line {
  width: 2px;
  flex: 1;
  background: var(--border-primary);
  min-height: 16px;
}

.ws-timeline-item:last-child .ws-timeline-line {
  display: none;
}

.ws-timeline-content {
  flex: 1;
  padding: 10px 16px;
  margin: 4px 0 4px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  border-left: 3px solid var(--border-primary);
  transition: border-color var(--transition-fast);
}

.ws-timeline-content.status-confirmed {
  border-left-color: var(--accent-green);
}

.ws-timeline-content.status-invalidated {
  border-left-color: var(--accent-red);
}

.ws-timeline-content.status-pending {
  border-left-color: var(--text-muted);
}

.ws-timeline-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.ws-timeline-step {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(188, 140, 255, 0.12);
  color: var(--accent-purple);
  font-family: var(--font-mono);
}

.ws-timeline-status-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: capitalize;
}

.ws-timeline-status-badge.status-pending {
  background: rgba(139, 148, 158, 0.15);
  color: var(--text-secondary);
}

.ws-timeline-status-badge.status-confirmed {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
}

.ws-timeline-status-badge.status-invalidated {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
}

.ws-timeline-item-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.ws-status-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
}

.ws-status-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.ws-status-btn[data-status="confirmed"]:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(63, 185, 80, 0.1);
}

.ws-status-btn[data-status="invalidated"]:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(248, 81, 73, 0.1);
}

.ws-status-btn[data-status="pending"]:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: rgba(210, 153, 34, 0.1);
}

.ws-item-delete-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
}

.ws-item-delete-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(248, 81, 73, 0.1);
}

.ws-timeline-item-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.ws-timeline-item-text:hover {
  border-color: var(--border-primary);
  background: var(--bg-tertiary);
}

.ws-timeline-item-text-input {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  min-height: 60px;
}

.ws-timeline-item-text-input:focus {
  border-color: var(--accent-blue);
}

.ws-timeline-item-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-style: italic;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.ws-timeline-item-note:hover {
  border-color: var(--border-primary);
  background: var(--bg-tertiary);
}

.ws-timeline-item-note.empty {
  opacity: 0;
}

.ws-timeline-item:hover .ws-timeline-item-note.empty {
  opacity: 0.6;
}

.ws-timeline-item-note-input {
  width: 100%;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  outline: none;
  margin-top: 4px;
}

.ws-timeline-item-note-input:focus {
  border-color: var(--accent-blue);
}

.ws-timeline-item-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== Add Item ===== */
.ws-add-item {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-left: 44px;
}

.ws-add-item-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.ws-add-item-input:focus {
  border-color: var(--accent-purple);
}

.ws-add-item-input::placeholder {
  color: var(--text-muted);
}

.ws-add-item-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent-purple);
  background: rgba(188, 140, 255, 0.12);
  color: var(--accent-purple);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.ws-add-item-btn:hover {
  background: rgba(188, 140, 255, 0.25);
}

/* ===== Modal ===== */
.ws-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ws-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

.ws-modal h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.ws-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.ws-modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.ws-modal-field {
  margin-bottom: 20px;
}

.ws-modal-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== Market Selector (searchable dropdown) ===== */
.ws-market-selector {
  position: relative;
}

.ws-market-search {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.ws-market-search:focus {
  border-color: var(--accent-blue);
}

.ws-market-search::placeholder {
  color: var(--text-muted);
}

.ws-market-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-top: none;
  border-radius: 0 0 6px 6px;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.ws-market-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.ws-market-option {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.ws-market-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ws-market-option .market-opt-id {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-blue);
  margin-right: 6px;
}

.ws-market-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-blue);
  border-radius: 6px;
}

.ws-market-selected-name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
}

.ws-market-clear {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.ws-market-clear:hover {
  color: var(--text-primary);
  background: var(--border-primary);
}

/* Modal goal textarea */
.ws-modal-goal {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.ws-modal-goal:focus {
  border-color: var(--accent-blue);
}

.ws-modal-goal::placeholder {
  color: var(--text-muted);
}

/* Modal create button */
.ws-modal-create {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: none;
  background: var(--accent-purple);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
  margin-top: 4px;
}

.ws-modal-create:hover {
  background: #a370e8;
}

.ws-modal-create:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Outcome Badge (list cards) ===== */
.ws-outcome-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.ws-outcome-badge.outcome-won {
  background: rgba(63, 185, 80, 0.2);
  color: var(--accent-green);
}

.ws-outcome-badge.outcome-lost {
  background: rgba(248, 81, 73, 0.2);
  color: var(--accent-red);
}

.ws-outcome-badge.outcome-be {
  background: rgba(139, 148, 158, 0.2);
  color: var(--text-muted);
}

/* ===== Risk Calculator ===== */
.ws-calc-section {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 28px;
}

.ws-calc-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.ws-calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.ws-calc-row {
  display: flex;
  gap: 12px;
}

.ws-calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.ws-calc-input-group label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.ws-calc-field {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.ws-calc-field:focus {
  border-color: var(--accent-blue);
}

.ws-calc-direction {
  display: flex;
  gap: 4px;
}

.ws-calc-dir-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-calc-dir-btn.active {
  background: rgba(88, 166, 255, 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.ws-calc-output {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.ws-calc-output-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.ws-calc-output-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.ws-calc-output-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.ws-calc-output-card.calc-risk .ws-calc-output-label { color: var(--accent-green); }
.ws-calc-output-card.calc-pos .ws-calc-output-label { color: var(--accent-blue); }
.ws-calc-output-card.calc-rr .ws-calc-output-label { color: var(--accent-orange); }
.ws-calc-output-card.calc-profit .ws-calc-output-label { color: var(--accent-green); }

/* ===== Trade Outcome ===== */
.ws-outcome-section {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 28px;
}

.ws-outcome-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.ws-outcome-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.ws-outcome-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid var(--border-primary);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.ws-outcome-btn.outcome-won { border-color: var(--accent-green); color: var(--accent-green); }
.ws-outcome-btn.outcome-won:hover, .ws-outcome-btn.outcome-won.selected { background: rgba(63, 185, 80, 0.15); }

.ws-outcome-btn.outcome-lost { border-color: var(--accent-red); color: var(--accent-red); }
.ws-outcome-btn.outcome-lost:hover, .ws-outcome-btn.outcome-lost.selected { background: rgba(248, 81, 73, 0.15); }

.ws-outcome-btn.outcome-breakeven { border-color: var(--text-muted); color: var(--text-secondary); }
.ws-outcome-btn.outcome-breakeven:hover, .ws-outcome-btn.outcome-breakeven.selected { background: rgba(139, 148, 158, 0.15); }

.ws-outcome-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-outcome-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-outcome-display-row {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-outcome-result-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.ws-outcome-result-badge.outcome-won { background: rgba(63, 185, 80, 0.15); color: var(--accent-green); }
.ws-outcome-result-badge.outcome-lost { background: rgba(248, 81, 73, 0.15); color: var(--accent-red); }
.ws-outcome-result-badge.outcome-breakeven { background: rgba(139, 148, 158, 0.15); color: var(--text-muted); }

.ws-outcome-notes {
  font-style: italic;
  color: var(--text-muted);
}

.ws-outcome-actions {
  display: flex;
  gap: 8px;
}

/* ===== Mode Toggle (Live Trades / Backtests) ===== */
.ws-mode-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.ws-mode-btn {
  flex: 1;
  max-width: 160px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-mode-btn.active {
  background: rgba(188, 140, 255, 0.15);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.ws-mode-btn:hover:not(.active) {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* ===== Backtest Cards ===== */
.bt-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.bt-stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.bt-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-blue);
  font-family: var(--font-mono);
}

.bt-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 4px;
}

.bt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--card-radius);
  padding: 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.bt-card:hover {
  border-color: var(--text-muted);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bt-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bt-card-market {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-blue);
  font-family: var(--font-mono);
}

.bt-card-timeframe {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(188, 140, 255, 0.12);
  color: var(--accent-purple);
  font-weight: 600;
  font-family: var(--font-mono);
}

.bt-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.bt-card-pattern {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.bt-card-notes {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.4;
}

.bt-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bt-outcome-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.bt-outcome-badge.bt-outcome-worked {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
}

.bt-outcome-badge.bt-outcome-failed {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
}

.bt-outcome-badge.bt-outcome-partial {
  background: rgba(210, 153, 34, 0.15);
  color: var(--accent-orange);
}

.bt-delete-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
}

.bt-delete-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(248, 81, 73, 0.1);
}

/* ===== TradingView Chart Section ===== */
.ws-chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 28px;
}

.ws-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.ws-chart-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.ws-chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-chart-intervals {
  display: flex;
  gap: 4px;
}

.ws-chart-interval-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-chart-interval-btn.active {
  background: rgba(88, 166, 255, 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.ws-chart-interval-btn:hover:not(.active) {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.ws-chart-toggle {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-chart-toggle:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.ws-chart-container {
  height: 400px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

/* ===== Mistake Tagger (in outcome section) ===== */
.ws-mistake-tagger {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-secondary);
}

.ws-mistake-tagger h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.ws-mistake-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.ws-mistake-chip {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.ws-mistake-chip:hover {
  border-color: var(--text-muted);
}

.ws-mistake-chip.selected {
  background: rgba(248, 81, 73, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.ws-mistake-save-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent-blue);
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ws-mistake-save-btn:hover {
  background: rgba(88, 166, 255, 0.25);
}

.ws-mistake-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.ws-mistake-tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(248, 81, 73, 0.12);
  color: var(--accent-red);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .ws-section {
    padding: calc(var(--header-height) + 16px) 16px 32px;
  }

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

  .ws-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ws-detail-meta {
    width: 100%;
    justify-content: space-between;
  }

  .ws-chart-container {
    height: 300px;
  }

  .ws-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .bt-stats-row {
    flex-wrap: wrap;
  }

  .bt-stat-card {
    min-width: calc(50% - 6px);
  }
}

@media (max-width: 480px) {
  .ws-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ws-create-btn {
    width: 100%;
    justify-content: center;
  }

  .detail-breadcrumb {
    display: none;
  }

  .ws-add-item {
    padding-left: 0;
    flex-direction: column;
  }

  .ws-add-item-btn {
    width: 100%;
    text-align: center;
  }

  .ws-calc-row {
    flex-direction: column;
  }

  .ws-calc-output {
    grid-template-columns: 1fr;
  }

  .ws-outcome-buttons {
    flex-direction: column;
  }

  .ws-chart-container {
    height: 250px;
  }

  .ws-mode-btn {
    max-width: none;
  }

  .bt-stat-card {
    min-width: 100%;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .ws-calc-output {
    grid-template-columns: repeat(2, 1fr);
  }
}
