/* Equilibrium Core Styling System (Premium Dark Glassmorphism CSS) */

:root {
  /* Colors */
  --bg-primary: #05060f;
  --bg-surface: rgba(13, 15, 28, 0.65);
  --border-glow: rgba(99, 102, 241, 0.15);
  --border-light: rgba(255, 255, 255, 0.08);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --primary-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Fonts */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, "Liberation Mono", Menlo, monospace;

  --sidebar-width: 260px;
  --header-height: 70px;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated Radiant Mesh Background */
.bg-gradient-radial {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(5, 6, 15, 1) 0%, rgba(3, 4, 10, 1) 100%);
  background-size: 200% 200%;
  animation: bgAnimation 25s ease infinite;
}

@keyframes bgAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Typography & logo styling */
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

/* Glassmorphism Card System */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 8px 36px 0 rgba(99, 102, 241, 0.08);
}

/* Layout System */
.app-container {
  display: flex;
  min-height: 100vh;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.app-container.hidden {
  display: none;
  opacity: 0;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(8, 9, 20, 0.85);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.sidebar-brand {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 20px 0 var(--primary-glow);
}

.nav-btn svg {
  opacity: 0.7;
}

.nav-btn.active svg {
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
}

/* Main Content Styling */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.header-status-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Status Pills */
.status-pill {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 30px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
}

.state-idle {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.state-calculating {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.state-holding {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.state-exit {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.state-emergency {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid #ef4444;
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Badges */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-online {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  align-self: flex-start;
}

/* Tab Views management */
.tab-view {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Dashboard Card Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1400px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.kpi-card:nth-child(2)::before { background: #3b82f6; }
.kpi-card:nth-child(3)::before { background: var(--success); }
.kpi-card:nth-child(4)::before { background: var(--warning); }

.kpi-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-vulgarization {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.indicator-guide {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.guide-item {
  display: block;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.guide-item strong {
  color: var(--text-secondary);
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.dashboard-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  margin-top: 24px;
}

.grid-2col-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 992px) {
  .grid-2col-equal {
    grid-template-columns: 1fr;
  }
}

.widget-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.widget-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
}

/* Position Info widget details */
.position-info-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.position-info-box.empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 40px 20px;
  border: 1px dashed var(--border-light);
  border-radius: 12px;
}

.position-pair {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  text-align: center;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pos-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pos-kpi .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pos-kpi .val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Health Gauge */
.health-gauge-wrapper {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

#health-ratio-text {
  font-family: var(--font-mono);
  font-weight: 600;
}

.gauge-container {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.gauge-fill {
  height: 100%;
  background: var(--success);
  width: 0%;
  border-radius: 5px;
  transition: width 0.5s ease, background-color 0.5s ease;
}

.gauge-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.pnl-box {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
}

.pnl-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pnl-item .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pnl-item .val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Chart widget */
.chart-widget {
  min-height: 380px;
}

.chart-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

/* Form Styles (Settings & Login) */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  width: 100%;
  outline: none;
}

.form-group select option {
  background-color: #0b0c15;
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px 0 rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border: 1px solid var(--border-light);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

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

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Separator Line */
.separator {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 32px 0;
}

/* Button System */
.btn {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 16px 0 var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-gradient);
  color: #fff;
  box-shadow: 0 4px 16px 0 var(--danger-glow);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 var(--danger-glow);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 16px 0 var(--success-glow);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 var(--success-glow);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Emergency section inside settings */
.emergency-section {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.danger-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #f87171;
}

.danger-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Terminal logs view */
.terminal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: calc(100vh - 140px);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-body {
  flex: 1;
  background: #020205;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-line {
  word-break: break-all;
  white-space: pre-wrap;
}

.log-info { color: #22d3ee; }  /* Cyan */
.log-warn { color: #fbbf24; }  /* Yellow */
.log-error { color: #f87171; } /* Red */
.log-debug { color: #64748b; } /* Slate */

/* Table Ledger */
.ledger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.ledger-table th,
.ledger-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.ledger-table th {
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}

.ledger-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.ledger-table td {
  color: var(--text-secondary);
}

.text-center { text-align: center; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

/* Connection Screen Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 4, 10, 0.85);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.login-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #f87171;
  font-size: 0.85rem;
  padding: 10px;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Header Notification Banner */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.banner-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-icon {
  font-size: 1.25rem;
}

.animate-pulse {
  animation: pulse-border 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(239, 68, 68, 0.3); }
  50% { border-color: rgba(239, 68, 68, 0.8); }
}

/* Modal configuration overlay */
.modal-card {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.modal-card h3 {
  font-family: var(--font-display);
  color: #f87171;
}

.modal-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Responsive UI adjustments */
@media (max-width: 992px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    width: 70px;
    padding: 24px 8px;
  }
  
  .logo-text, .logo-sub, .nav-btn span, .sidebar-footer button {
    display: none;
  }
  
  .sidebar-brand {
    padding-left: 0;
    align-items: center;
  }
  
  .nav-btn {
    justify-content: center;
    padding: 12px;
  }
  
  .main-content {
    margin-left: 70px;
  }
}

/* Card Vulgarization Descriptions */
.card-vulgarization {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  text-align: left;
}

.kpi-card .card-vulgarization {
  margin-top: 8px;
}

/* Live Position Comparison Box */
.live-comp-box {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-price-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 8px;
}

.val-live {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: #22d3ee;
}

.comp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.comp-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.01);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.comp-title {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comp-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 2px;
}

.comp-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.comp-net {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.comp-net-val {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* FSM Progress Bar Styles */
.fsm-progress-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  margin-bottom: 8px;
  background: rgba(13, 15, 28, 0.45);
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.fsm-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.fsm-step .step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.fsm-step .step-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.fsm-step-connector {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  margin: 0 12px;
  position: relative;
  transition: all 0.3s ease;
}

/* Active states */
.fsm-step.active {
  opacity: 1;
}

.fsm-step.active .step-dot {
  background: var(--primary);
  box-shadow: 0 0 10px 3px var(--primary-glow);
}

.fsm-step.active .step-text {
  color: var(--text-primary);
  font-weight: 600;
}

/* Specific state variations */
.fsm-step.active.state-active-idle .step-dot {
  background: #3b82f6;
  box-shadow: 0 0 10px 3px rgba(59, 130, 246, 0.5);
}
.fsm-step.active.state-active-calculating .step-dot {
  background: #f59e0b;
  box-shadow: 0 0 10px 3px rgba(245, 158, 11, 0.5);
}
.fsm-step.active.state-active-entry .step-dot {
  background: #a855f7;
  box-shadow: 0 0 10px 3px rgba(168, 85, 247, 0.5);
}
.fsm-step.active.state-active-holding .step-dot {
  background: #10b981;
  box-shadow: 0 0 10px 3px rgba(16, 185, 129, 0.5);
}
.fsm-step.active.state-active-exit .step-dot {
  background: #ef4444;
  box-shadow: 0 0 10px 3px rgba(239, 68, 68, 0.5);
}
.fsm-step.active.state-active-emergency .step-dot {
  background: #ef4444;
  box-shadow: 0 0 12px 4px #ef4444;
  animation: pulse-danger-dot 1.5s infinite;
}

@keyframes pulse-danger-dot {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Connector filled states */
.fsm-step-connector.filled {
  background: var(--primary-gradient);
}

/* Indicator Guides styling */
.indicator-guide {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.3;
}

.guide-item strong {
  font-weight: 600;
}

.guide-item.beneficial {
  color: #a7f3d0; /* Soft green */
}

.guide-item.neutral {
  color: #fef3c7; /* Soft yellow */
}

.guide-item.bad {
  color: #fecaca; /* Soft red */
}

/* Dynamic KPI Card Statuses */
.kpi-card {
  position: relative;
}

.kpi-card.status-beneficial::before {
  background: var(--success) !important;
  box-shadow: 0 0 12px 2px var(--success-glow);
}

.kpi-card.status-neutral::before {
  background: var(--warning) !important;
  box-shadow: 0 0 12px 2px var(--warning-glow);
}

.kpi-card.status-bad::before {
  background: var(--danger) !important;
  box-shadow: 0 0 12px 2px var(--danger-glow);
}

/* Top Opportunities Styles */
.top-opportunities-wrapper {
  padding: 12px 18px !important;
  margin-bottom: 8px;
}

.section-subtitle {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-opp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) {
  .top-opp-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .top-opp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.opp-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.opp-card:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.opp-symbol {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.opp-rank {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 4px;
  border-radius: 4px;
}

.opp-apr {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--success);
}

.opp-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.opp-spread {
  font-family: var(--font-mono);
}

.opp-vol {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.opp-card-placeholder {
  grid-column: span 6;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 10px;
  font-size: 0.8rem;
}

/* Market View Layout & Card Styles */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.market-card {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.market-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

.market-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background-color 0.3s ease;
}

.market-card.status-conforme::before {
  background: var(--success);
}
.market-card.status-faible::before {
  background: var(--warning);
}
.market-card.status-spread::before {
  background: var(--danger);
}
.market-card.status-hors::before {
  background: var(--text-muted);
}

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

.market-symbol {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.market-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
}

.market-apr-wrapper {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.market-apr-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
}

.market-apr-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.market-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.market-price-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.market-price-item .label {
  color: var(--text-muted);
}

.market-price-item .val {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.market-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 10px;
}

.market-spread-val {
  font-family: var(--font-mono);
  font-weight: 500;
}

.market-vol-val {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.market-badge {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-conforme {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-faible {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-spread {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-hors {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Full width dashboard layout modifier */
.dashboard-layout.full-width {
  grid-template-columns: 1fr;
}


