/* Apple-like Card System */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.08);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Card variants */
.card-premium {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--brand-rgb, 6, 182, 212), 0.2);
  box-shadow:
    0 0 20px rgba(var(--brand-rgb, 6, 182, 212), 0.06),
    0 2px 8px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-premium:hover {
  border-color: rgba(var(--brand-rgb, 6, 182, 212), 0.35);
  box-shadow:
    0 0 30px rgba(var(--brand-rgb, 6, 182, 212), 0.1),
    0 4px 16px rgba(0, 0, 0, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.1);
}

.card-glass {
  background: rgba(255, 255, 255, 0.02);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

.card-gradient {
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}

/* Card Header - Apple-like clean design */
.card .hd, .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 16px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
  background: transparent;
}

.card-title,
h3.card-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.4;
}

/* Card Body - Apple-like spacing */
.card .bd, .card-body {
  padding: 20px;
  flex: 1;
}

.card-content {
  padding: var(--space-4) var(--space-6);
}

/* Card Footer */
.card .ft, .card-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

/* Apple-like Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px; /* Comfortable touch target */
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover {
  transform: scale(0.98);
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.35);
}

.btn:active {
  transform: scale(0.96);
  background: rgba(6, 182, 212, 0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Mobile-specific button improvements */
@media (max-width: 768px) {
  .btn {
    min-height: 44px; /* iOS minimum touch target */
    padding: 10px 18px;
    font-size: 15px;
  }

  .btn-sm {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 14px;
  }

  .btn-lg {
    min-height: 50px;
    padding: 14px 24px;
    font-size: 16px;
  }
}

/* Button variants */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--panel-hover);
  border-color: var(--border-focus);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--panel-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--accent-emerald) 100%);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, var(--accent-amber) 100%);
}

.btn-error {
  background: linear-gradient(135deg, var(--error) 0%, var(--accent-rose) 100%);
}

/* Button sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  gap: var(--space-1);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  gap: var(--space-3);
}

.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
  gap: var(--space-3);
}

/* Icon buttons */
.btn-icon {
  padding: var(--space-3);
  aspect-ratio: 1;
  border-radius: var(--radius-full);
}

.btn-icon-sm {
  padding: var(--space-2);
}

.btn-icon-lg {
  padding: var(--space-4);
}

/* Premium Empty States */
.empty-state,
.empty-widget {
  text-align: center;
  padding: var(--space-4) var(--space-4);
  color: var(--text-tertiary);
}

.empty-state-icon,
.empty-icon {
  font-size: 2rem;
  margin: 0 auto var(--space-3);
  opacity: 0.4;
  display: block;
}

.empty-state-title,
.empty-widget > div:not(.empty-icon):not(.empty-subtitle) {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.empty-state-description,
.empty-subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-tertiary);
  max-width: 300px;
  margin: 0 auto;
}

/* Apple-like Grid System with optimized spacing */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

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

/* Responsive grids */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { 
    grid-template-columns: 1fr; 
    gap: var(--space-4);
  }
  
  .card .hd, .card-header,
  .card .bd, .card-body,
  .card .ft, .card-footer {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* Loading States */
.card-loading {
  overflow: hidden;
  position: relative;
}

.card-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--panel-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer-pass 2s infinite;
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-4);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

@keyframes shimmer-pass {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Premium Dashboard Components */
.dashboard-container {
  animation: fadeInUp var(--duration-500) var(--ease-out);
}

.page-header {
  margin-bottom: var(--space-2);
  text-align: center;
}

.stat-icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
  opacity: 0.8;
}

.stat-value {
  font-size: var(--text-4xl, 2.25rem);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Premium animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Staggered animations for grid items */
.grid-1 > .card:nth-child(1) { animation: fadeInUp var(--duration-500) var(--ease-out) 0.1s both; }
.grid-2 > .card:nth-child(1) { animation: slideInLeft var(--duration-500) var(--ease-out) 0.1s both; }
.grid-2 > .card:nth-child(2) { animation: slideInRight var(--duration-500) var(--ease-out) 0.2s both; }
.grid-3 > .card:nth-child(1) { animation: fadeInUp var(--duration-500) var(--ease-out) 0.1s both; }
.grid-3 > .card:nth-child(2) { animation: fadeInUp var(--duration-500) var(--ease-out) 0.2s both; }
.grid-3 > .card:nth-child(3) { animation: fadeInUp var(--duration-500) var(--ease-out) 0.3s both; }
.grid-4 > .card:nth-child(1) { animation: fadeInUp var(--duration-500) var(--ease-out) 0.1s both; }
.grid-4 > .card:nth-child(2) { animation: fadeInUp var(--duration-500) var(--ease-out) 0.2s both; }
.grid-4 > .card:nth-child(3) { animation: fadeInUp var(--duration-500) var(--ease-out) 0.3s both; }
.grid-4 > .card:nth-child(4) { animation: fadeInUp var(--duration-500) var(--ease-out) 0.4s both; }

/* Enhanced stat cards with hover effects */
.grid-4 .card-glass:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-glow);
}

.grid-4 .card-glass:hover .stat-icon {
  transform: scale(1.1);
  opacity: 1;
}

.grid-4 .card-glass:hover .stat-value {
  color: var(--brand);
}

/* Premium input fields */
.input-group {
  position: relative;
  margin-bottom: var(--space-6);
}

.input {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: all var(--duration-200) var(--ease-out);
}

.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 6, 182, 212), 0.1);
  background: var(--panel);
}

.input-label {
  position: absolute;
  top: var(--space-4);
  left: var(--space-5);
  color: var(--text-tertiary);
  font-size: var(--text-base);
  pointer-events: none;
  transition: all var(--duration-200) var(--ease-out);
}

.input:focus + .input-label,
.input:not(:placeholder-shown) + .input-label {
  top: -var(--space-2);
  left: var(--space-3);
  font-size: var(--text-sm);
  color: var(--brand);
  background: var(--bg);
  padding: 0 var(--space-2);
}

/* Premium select dropdown */
.select {
  position: relative;
  display: inline-block;
  width: 100%;
}

.select select {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-base);
  cursor: pointer;
  appearance: none;
  transition: all var(--duration-200) var(--ease-out);
}

.select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: var(--space-4);
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  pointer-events: none;
}

.select select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 6, 182, 212), 0.1);
}

/* Premium toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  transition: var(--duration-300) var(--ease-out);
  border-radius: var(--radius-full);
}

.toggle-slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: var(--duration-300) var(--ease-out);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
  background: var(--brand);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Premium badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-brand {
  background: rgba(var(--brand-rgb, 6, 182, 212), 0.1);
  color: var(--brand);
  border: 1px solid rgba(var(--brand-rgb, 6, 182, 212), 0.2);
}

/* Data mode badges - live/demo indicators */
.data-mode-badge {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  background: transparent;
  border: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  top: -2px;
}

.data-mode-badge.live {
  background: #10b981;
  opacity: 1;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.data-mode-badge.demo {
  background: #f59e0b;
  opacity: 1;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

/* ==========================================
   MODAL SYSTEM
   ========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-xl, 16px);
  width: 600px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
  border: 1px solid var(--border, #333);
}

.modal-content--sm {
  width: 400px;
}

.modal-content--lg {
  width: 800px;
}

.modal-header {
  padding: var(--space-6, 24px) var(--space-6, 24px) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  color: var(--text-primary, #fff);
  font-size: var(--text-xl, 20px);
  font-weight: var(--font-semibold, 600);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary, #888);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm, 4px);
  line-height: 1;
  transition: color var(--duration-200, 200ms) ease;
}

.modal-close:hover {
  color: var(--text-primary, #fff);
}

.modal-body {
  padding: var(--space-5, 20px) var(--space-6, 24px);
}

.modal-footer {
  display: flex;
  gap: var(--space-3, 12px);
  justify-content: flex-end;
  padding: var(--space-5, 20px) var(--space-6, 24px) var(--space-6, 24px);
  border-top: 1px solid var(--border, #333);
}

/* ==========================================
   COMPACT CARDS (KPI / Stat Cards)
   ========================================== */

.card-compact {
  background: var(--bg-surface, #141920);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-4, 16px);
  transition: all var(--duration-200, 200ms) ease;
}

.card-compact:hover {
  border-color: var(--border-light, #334155);
  transform: translateY(-1px);
}

.card-compact__label {
  font-size: 0.7rem;
  color: var(--text-tertiary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2, 8px);
  font-weight: 600;
}

.card-compact__value {
  font-size: var(--text-3xl, 1.875rem);
  font-weight: var(--font-bold, 700);
  color: var(--text-primary, #f8fafc);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.card-compact__value--positive {
  color: var(--success, #22c55e);
}

.card-compact__value--negative {
  color: var(--error, #ef4444);
}

.card-compact__delta {
  font-size: var(--text-sm, 14px);
  color: var(--text-secondary, #cbd5e1);
  margin-top: var(--space-1, 4px);
}

/* ==========================================
   SELECTABLE CARDS (Trade selection, etc.)
   ========================================== */

.card-selectable {
  padding: var(--space-3, 12px) var(--space-4, 16px);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all var(--duration-200, 200ms) ease;
  background: var(--bg-surface, #222);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-selectable:hover {
  border-color: var(--border-light, #444);
  background: var(--panel-hover, #1f2530);
}

.card-selectable--selected {
  border: 2px solid var(--brand, #06b6d4);
  background: rgba(var(--brand-rgb, 6, 182, 212), 0.1);
}

.card-selectable--dashed {
  border: 2px dashed var(--border, #333);
  justify-content: center;
  color: var(--text-secondary, #888);
}

.card-selectable--dashed:hover {
  border-color: var(--brand, #06b6d4);
  color: var(--brand, #06b6d4);
}

/* ==========================================
   FORM ELEMENTS (Inside modals/cards)
   ========================================== */

.form-group {
  margin-bottom: var(--space-4, 16px);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2, 8px);
  color: var(--text-primary, #fff);
  font-weight: var(--font-medium, 500);
  font-size: var(--text-sm, 14px);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3, 12px);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-surface, #222);
  color: var(--text-primary, #fff);
  font-size: var(--text-sm, 14px);
  font-family: inherit;
  transition: border-color var(--duration-200, 200ms) ease, box-shadow var(--duration-200, 200ms) ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand, #06b6d4);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 6, 182, 212), 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Emotion/Range slider container */
.form-slider-container {
  padding: var(--space-3, 12px);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-surface, #222);
}

.form-slider {
  width: 100%;
  margin-bottom: var(--space-2, 8px);
}

.form-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs, 12px);
  color: var(--text-secondary, #888);
}

.form-slider-value {
  color: var(--text-primary, #fff);
  font-weight: var(--font-semibold, 600);
}

/* ==========================================
   SIDE BADGES (Long/Short indicators)
   ========================================== */

.side-badge {
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  font-size: var(--text-xs, 12px);
  font-weight: var(--font-semibold, 600);
  text-transform: uppercase;
}

.side-badge--long {
  background: var(--success, #10b981);
  color: white;
}

.side-badge--short {
  background: var(--error, #ef4444);
  color: white;
}

/* ==========================================
   PNL DISPLAY
   ========================================== */

.pnl-value {
  font-weight: var(--font-semibold, 600);
}

.pnl-value--positive {
  color: var(--success, #10b981);
}

.pnl-value--negative {
  color: var(--error, #ef4444);
}

/* ==========================================
   JOURNAL SELECTOR
   Multi-journal system with pill/dropdown modes
   ========================================== */

.journal-selector-container {
  margin-top: var(--space-4);
}

.journal-selector-loading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--brand, #06b6d4);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

.journal-selector--pills .journal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.journal-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full, 9999px);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}

.journal-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.journal-pill.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.30);
  color: #67e8f9;
}

.journal-pill.active .trade-count {
  background: rgba(6, 182, 212, 0.20);
  color: #67e8f9;
}

.journal-pill .default-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  opacity: 0.7;
}

.journal-pill .trade-count {
  font-size: 11px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.journal-pill--add {
  background: transparent;
  border-style: dashed;
  color: var(--brand, #06b6d4);
}

.journal-pill--add:hover {
  background: rgba(var(--brand-rgb, 6, 182, 212), 0.1);
  border-color: var(--brand, #06b6d4);
}

.journal-limit-info {
  font-size: var(--text-xs);
  color: var(--text-tertiary, var(--text-secondary));
  opacity: 0.7;
}

/* Dropdown variant for >4 journals */
.journal-selector--dropdown .journal-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.journal-dropdown {
  min-width: 200px;
  max-width: 300px;
}

/* Page header adjustments for journal selector */
.page-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

/* Create Journal Modal styles */
#createJournalModal .form-group {
  margin-bottom: var(--space-4);
}

#createJournalModal .form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

#createJournalModal .input {
  width: 100%;
}

#createJournalModal textarea.input {
  resize: vertical;
  min-height: 60px;
}

/* ==========================================
   SELECT/DROPDOWN FIX - Dark Mode
   Fix white background on select options
   ========================================== */

select,
.form-select,
.input[type="select"],
select.input {
  background-color: var(--bg-surface, #1a1a1a) !important;
  color: var(--text-primary, #fff) !important;
  border: 1px solid var(--border, #333);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-3, 12px);
  font-size: var(--text-sm, 14px);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

select:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand, #06b6d4);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 6, 182, 212), 0.1);
}

/* Option styling - force dark background */
select option,
.form-select option {
  background-color: var(--bg-surface, #1a1a1a) !important;
  color: var(--text-primary, #fff) !important;
  padding: 8px 12px;
}

select option:hover,
select option:focus,
select option:checked,
.form-select option:hover,
.form-select option:focus,
.form-select option:checked {
  background-color: var(--brand, #06b6d4) !important;
  color: white !important;
}

/* Firefox specific fix */
@-moz-document url-prefix() {
  select,
  .form-select {
    background-color: var(--bg-surface, #1a1a1a) !important;
    color: var(--text-primary, #fff) !important;
  }

  select option,
  .form-select option {
    background-color: var(--bg-surface, #1a1a1a) !important;
    color: var(--text-primary, #fff) !important;
  }
}

/* Journal dropdown specific */
.journal-dropdown,
#journalDropdown {
  background-color: var(--bg-surface, #1a1a1a) !important;
  color: var(--text-primary, #fff) !important;
}

.journal-dropdown option,
#journalDropdown option {
  background-color: var(--bg-surface, #1a1a1a) !important;
  color: var(--text-primary, #fff) !important;
}

/* Journal filter dropdown */
#journalFilter {
  background-color: var(--bg-surface, #1a1a1a) !important;
  color: var(--text-primary, #fff) !important;
}

#journalFilter option {
  background-color: var(--bg-surface, #1a1a1a) !important;
  color: var(--text-primary, #fff) !important;
}
/* ========================================
   Filter Chips (Dex Alpha Standard)
   ======================================== */

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border, #333);
  background: var(--bg-surface, #1a1a1a);
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--brand, #06b6d4);
  background: rgba(var(--brand-rgb, 6, 182, 212), 0.1);
  color: var(--text-primary, #fff);
}

.filter-chip.active {
  border-color: rgba(var(--brand-rgb, 6, 182, 212), 0.4);
  background: rgba(var(--brand-rgb, 6, 182, 212), 0.15);
  color: var(--brand, #06b6d4);
  font-weight: 600;
}

/* Filter chip with clear button (for active filters) */
.filter-chip--clearable {
  padding-right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip__clear {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}

.filter-chip.active .filter-chip__clear:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* Filter chip group (mutually exclusive) */
.filter-chip-group {
  display: inline-flex;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border, #333);
}

.filter-chip-group .filter-chip {
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--border, #333);
}

.filter-chip-group .filter-chip:last-child {
  border-right: none;
}

.filter-chip-group .filter-chip:first-child {
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
}

.filter-chip-group .filter-chip:last-child {
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
}

/* Separator between filter sections */
.filter-chips-separator {
  width: 1px;
  height: 16px;
  background: var(--border, #333);
  margin: 0 4px;
}

/* ========================================
   Semantic Card Types (Journal/Analytics)
   ======================================== */

/* Base stat card - centered content */
.stat-card {
  padding: var(--space-6, 1.5rem);
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border, #333);
  text-align: center;
}

.stat-card--compact {
  padding: var(--space-4, 1rem);
  border-radius: var(--radius-md, 8px);
}

/* Strategy card - grid layout with icon/content/stats */
.strategy-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4, 1rem);
  padding: var(--space-6, 1.5rem);
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border, #333);
  align-items: center;
}

/* Emotion strategy card - 2 column grid */
.emotion-strategy-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4, 1rem);
  padding: var(--space-4, 1rem);
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border, #333);
  align-items: center;
}

/* Condition strategy card - simple padding */
.condition-strategy-card {
  padding: var(--space-4, 1rem);
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border, #333);
}

/* EV metric card - centered (expected value) */
.ev-metric-card {
  padding: var(--space-6, 1.5rem);
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border, #333);
  text-align: center;
}

/* Recommendation card - contextual variants */
.recommendation-card {
  padding: var(--space-6, 1.5rem);
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border, #333);
}

.recommendation-card.success {
  background: linear-gradient(135deg, var(--success-alpha, rgba(34, 197, 94, 0.1)), var(--success-muted, rgba(34, 197, 94, 0.05)));
  border-color: var(--success, #22c55e);
}

.recommendation-card.warning {
  background: linear-gradient(135deg, var(--warning-alpha, rgba(245, 158, 11, 0.1)), var(--warning-muted, rgba(245, 158, 11, 0.05)));
  border-color: var(--warning, #f59e0b);
}

.recommendation-card.info {
  background: linear-gradient(135deg, var(--info-alpha, rgba(59, 130, 246, 0.1)), var(--info-muted, rgba(59, 130, 246, 0.05)));
  border-color: var(--info, #3b82f6);
}

.recommendation-card.secondary {
  background: linear-gradient(135deg, var(--border, #333), var(--bg-secondary, #1f1f1f));
  border-color: var(--border, #333);
}

/* KPI card - interactive stat card for filtering */
.kpi-card {
  background: var(--bg-surface, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-3, 12px) var(--space-4, 14px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.kpi-card:hover {
  border-color: var(--border-light, #444);
  background: var(--panel-hover, #1f2530);
}

.kpi-card.active {
  border-color: var(--brand, #06b6d4);
  background: rgba(var(--brand-rgb, 6, 182, 212), 0.1);
}

/* Watchlist card - wallet/address display */
.watchlist-card {
  background: var(--bg-surface, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-4, 16px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.watchlist-card:hover {
  border-color: var(--border-light, #444);
  background: var(--panel-hover, #1f2530);
}

.watchlist-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.watchlist-card-positions {
  display: none;
  margin-top: var(--space-4, 16px);
  padding-top: var(--space-4, 16px);
  border-top: 1px solid var(--border, #333);
}

.watchlist-card.expanded .watchlist-card-positions {
  display: block;
}

/* Mover card - price movers display */
.mover-card {
  background: var(--bg-surface, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-3, 12px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mover-card:hover {
  border-color: var(--border-light, #444);
  background: var(--panel-hover, #1f2530);
}

/* Insight card mini - small insight boxes */
.insight-card-mini {
  padding: var(--space-3, 12px);
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border, #333);
}

/* Rule card - trading rule display */
.rule-card {
  padding: var(--space-4, 1rem);
  background: var(--bg-surface, #1a1a1a);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border, #333);
}

.rule-card.enabled {
  border-left: 3px solid var(--success, #22c55e);
}

.rule-card.disabled {
  opacity: 0.6;
  border-left: 3px solid var(--text-tertiary, #64748b);
}

.rule-card.severity-high {
  border-left-color: var(--error, #ef4444);
}

.rule-card.severity-medium {
  border-left-color: var(--warning, #f59e0b);
}

.rule-card.severity-low {
  border-left-color: var(--info, #3b82f6);
}

/* ==========================================
   SETTINGS COMPONENTS
   ========================================== */

/* Toggle switch — minimal, inline with text label */
.setting-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 0;
  -webkit-user-select: none;
  user-select: none;
}

.setting-switch input {
  -webkit-appearance: none;
  appearance: none;
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 1.5px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.setting-switch input:checked + .switch-slider {
  background: rgba(6, 182, 212, 0.25);
  border-color: rgba(6, 182, 212, 0.3);
}

.setting-switch input:checked + .switch-slider::before {
  transform: translateX(16px);
  background: var(--brand, #06b6d4);
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.4);
}

.setting-switch:hover .switch-slider {
  border-color: rgba(255, 255, 255, 0.15);
}

.switch-label {
  font-size: 13px;
  color: var(--text-secondary, #cbd5e1);
  font-weight: 400;
  line-height: 1.3;
}

.setting-switch input:checked ~ .switch-label {
  color: var(--text-primary, #f8fafc);
}

/* Setting groups */
.setting-group {
  margin-bottom: 4px;
}

.setting-group__heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px 0;
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
  margin-bottom: 6px;
  display: block;
}

.setting-hint {
  font-size: 12px;
  color: var(--text-tertiary, #64748b);
  margin: 4px 0 0;
  line-height: 1.4;
}

.setting-input {
  background: var(--bg-surface, #141920);
  border: 1px solid var(--border, #1e293b);
  border-radius: var(--radius-md, 8px);
  color: var(--text-primary, #f8fafc);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.15s ease;
}

.setting-input:focus {
  outline: none;
  border-color: var(--brand, #06b6d4);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.2);
}

.setting-input::placeholder {
  color: var(--text-tertiary, #64748b);
}

/* ==========================================
   PROFILE-SPECIFIC COMPONENTS
   ========================================== */

/* Stat grid for public profile */
.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* Profile section label */
.profile-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px 0;
}

/* Profile tags */
.profile-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(var(--brand-rgb, 6, 182, 212), 0.08);
  color: var(--brand, #06b6d4);
  border: 1px solid rgba(var(--brand-rgb, 6, 182, 212), 0.15);
}

/* Social link row */
.profile-social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary, #cbd5e1);
  text-decoration: none;
  transition: color 0.15s ease;
}

.profile-social-link:hover {
  color: var(--brand, #06b6d4);
}

/* Verified badge */
.profile-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
