:root {
      --bg-base: #101114;
      --bg-surface: #15161a;
      --bg-card: #1a1c21;
      --bg-card-hover: #1f2127;
      --bg-inset: #131418;
      
      --border: rgba(255, 255, 255, 0.08);
      --border-hover: rgba(255, 255, 255, 0.16);
      
      --text-main: #f3f4f6;
      --text-secondary: #9ca3af;
      --text-muted: #6b7280;
      
      --steel: #9ca3af;
      --steel-light: #d1d5db;
      
      --win: #10b981;
      --loss: #f43f5e;
      
      --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: 'JetBrains Mono', monospace;
    }

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

    body {
      font-family: var(--font-ui);
      background-color: var(--bg-base);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-rendering: optimizeLegibility;
      font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum";
    }

    /* Scrollbar */
    ::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    ::-webkit-scrollbar-track {
      background: var(--bg-base);
    }
    ::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.12);
      border-radius: 3px;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.25);
    }

    /* Header */
    header {
      padding: 0.9rem 2rem;
      background: var(--bg-surface);
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .brand-group {
      display: flex;
      align-items: center;
      gap: 1.25rem;
    }

    .brand-logo {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      text-decoration: none;
    }

    .logo-icon {
      position: relative;
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      background: radial-gradient(circle at 25% 0%, rgba(52, 211, 153, 0.13), transparent 72%), linear-gradient(145deg, #192a2b, #0c141b);
      border: 1px solid rgba(110, 231, 183, 0.25);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: inset 0 1px 0 rgba(209, 250, 229, 0.12), 0 4px 12px rgba(0, 0, 0, 0.22);
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .logo-icon::before {
      content: '';
      position: absolute;
      inset: 3px;
      border: 1px solid rgba(167, 243, 208, 0.06);
      border-radius: inherit;
      pointer-events: none;
    }

    .logo-icon:hover {
      border-color: rgba(110, 231, 183, 0.42);
      box-shadow: inset 0 1px 0 rgba(209, 250, 229, 0.16), 0 4px 16px rgba(0, 0, 0, 0.26);
    }

    .logo-icon svg {
      width: 28px;
      height: 28px;
      fill: none;
    }

    .logo-text h1 {
      font-size: 1.05rem;
      font-weight: 800;
      letter-spacing: -0.025em;
      color: var(--text-main);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .logo-text h1 span {
      font-size: 0.74rem;
      font-weight: 700;
      padding: 0.14rem 0.5rem;
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-secondary);
      border-radius: 4px;
      border: 1px solid var(--border);
      letter-spacing: 0.06em;
    }

    .logo-text p {
      font-size: 0.76rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
      letter-spacing: 0.04em;
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .engine-status-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.55rem;
      padding: 0.38rem 0.65rem 0.38rem 0.75rem;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 0.80rem;
      font-weight: 600;
      color: var(--text-secondary);
      font-family: var(--font-mono);
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
      user-select: none;
    }

    .engine-status-btn:hover {
      background: rgba(255, 255, 255, 0.06);
      border-color: rgba(255, 255, 255, 0.2);
      transform: translateY(-1px);
    }

    .status-dot {
      width: 6px;
      height: 6px;
      background: var(--win);
      border-radius: 50%;
      transition: all 0.3s ease;
    }

    .status-dot.dot-paused {
      background: #f59e0b;
      box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
      animation: pulse-dot 1.5s infinite ease-in-out;
    }

    .status-dot.dot-offline { background: var(--loss); box-shadow: 0 0 8px rgba(248, 113, 113, 0.55); }
    .status-dot.dot-stale { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.55); }
    .status-dot.dot-connecting { background: var(--steel); animation: pulse-dot 1.5s infinite ease-in-out; }

    @keyframes pulse-dot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.35; transform: scale(0.85); }
    }

    .engine-action-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.28rem;
      padding: 0.12rem 0.42rem;
      border-radius: 4px;
      font-size: 0.68rem;
      font-weight: 600;
      font-family: var(--font-ui);
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
      color: var(--text-secondary);
      transition: all 0.2s ease;
    }

    .engine-status-btn:hover .engine-action-badge {
      background: rgba(248, 113, 113, 0.14);
      border-color: rgba(248, 113, 113, 0.3);
      color: #fca5a5;
    }

    .engine-status-btn.is-paused {
      background: rgba(245, 158, 11, 0.06);
      border-color: rgba(245, 158, 11, 0.25);
      color: #fbbf24;
    }

    .engine-status-btn.is-paused .engine-action-badge {
      background: rgba(52, 211, 153, 0.1);
      border-color: rgba(52, 211, 153, 0.3);
      color: #6ee7b7;
    }

    .engine-status-btn.is-paused:hover .engine-action-badge {
      background: rgba(52, 211, 153, 0.2);
      border-color: rgba(52, 211, 153, 0.5);
      color: #fff;
    }

    /* Dashboard Switcher - Minimalist Segmented Control */
    .dashboard-switcher {
      display: inline-flex;
      align-items: center;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 2px;
      border-radius: 7px;
      gap: 2px;
    }

    .dash-tab {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0.30rem 0.85rem;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-family: var(--font-ui);
      font-weight: 600;
      font-size: 0.80rem;
      border-radius: 5px;
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
      white-space: nowrap;
    }

    .dash-tab:hover {
      color: var(--text-main);
    }

    .dash-tab.active {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    }

    /* Crypto Dashboard Specific Styles */
    .crypto-hero-banner {
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.09) 0%, rgba(18, 23, 32, 0.95) 100%);
      border: 1px solid rgba(245, 158, 11, 0.25);
      border-radius: 12px;
      padding: 1.25rem 1.5rem;
      margin-bottom: 1.5rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 1rem;
    }

    .crypto-hero-left h2 {
      font-size: 1.25rem;
      font-weight: 800;
      color: #f1f5f9;
      display: flex;
      align-items: center;
      gap: 0.65rem;
      margin-bottom: 0.3rem;
    }

    .crypto-hero-left h2 span.gold-tag {
      font-size: 0.70rem;
      font-weight: 800;
      background: rgba(245, 158, 11, 0.2);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.4);
      padding: 0.15rem 0.5rem;
      border-radius: 4px;
    }

    .crypto-hero-left p {
      font-size: 0.84rem;
      color: var(--text-secondary);
    }

    .crypto-hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.9rem;
      background: rgba(52, 211, 153, 0.1);
      border: 1px solid rgba(52, 211, 153, 0.3);
      border-radius: 8px;
      font-size: 0.80rem;
      font-weight: 700;
      color: #34d399;
      font-family: var(--font-mono);
    }

    .crypto-cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 1rem;
      margin-bottom: 1.5rem;
    }

    .crypto-strategy-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 1.2rem;
      transition: all 0.25s ease;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    .crypto-strategy-card:hover {
      border-color: rgba(245, 158, 11, 0.4);
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    }

    .crypto-card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 0.75rem;
    }

    .crypto-strat-rank {
      font-size: 0.72rem;
      font-weight: 800;
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border);
      font-family: var(--font-mono);
    }

    .crypto-strat-rank.gold {
      background: rgba(245, 158, 11, 0.15);
      border-color: rgba(245, 158, 11, 0.4);
      color: #fbbf24;
    }

    .crypto-card-body h3 {
      font-size: 1.02rem;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 0.35rem;
    }

    .crypto-card-body p {
      font-size: 0.80rem;
      color: var(--text-muted);
      line-height: 1.4;
      margin-bottom: 0.85rem;
    }

    .crypto-stat-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.4rem 0;
      border-top: 1px solid rgba(255, 255, 255, 0.04);
      font-size: 0.80rem;
    }

    .crypto-stat-row span.label {
      color: var(--text-muted);
    }

    .crypto-stat-row span.val {
      font-family: var(--font-mono);
      font-weight: 700;
      color: var(--text-main);
    }

    .crypto-stat-row span.val.green {
      color: var(--win);
    }

    .crypto-tickers-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 1.25rem;
      margin-bottom: 1.5rem;
    }

    .crypto-ticker-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .crypto-ticker-card.btc {
      border-left: 4px solid #f59e0b;
    }

    .crypto-ticker-card.eth {
      border-left: 4px solid #6366f1;
    }

    .ticker-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .ticker-title {
      font-size: 1.1rem;
      font-weight: 800;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .ticker-price {
      font-family: var(--font-mono);
      font-size: 1.5rem;
      font-weight: 800;
      color: var(--text-main);
    }

    .ticker-details-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      background: var(--bg-card);
      padding: 0.75rem;
      border-radius: 8px;
      font-size: 0.76rem;
      font-family: var(--font-mono);
    }

    .crypto-backtest-box {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1.5rem;
      margin-bottom: 1.5rem;
    }

    .crypto-table-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 1rem;
      margin-bottom: 1.2rem;
    }

    .crypto-filter-btns {
      display: flex;
      gap: 0.5rem;
    }

    .crypto-filter-btn {
      padding: 0.35rem 0.8rem;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 0.76rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .crypto-filter-btn.active {
      background: rgba(245, 158, 11, 0.15);
      border-color: rgba(245, 158, 11, 0.4);
      color: #fbbf24;
    }

    .pause-banner {
      display: none;
      align-items: center;
      gap: 0.65rem;
      padding: 0.7rem 1.1rem;
      background: rgba(245, 158, 11, 0.08);
      border: 1px solid rgba(245, 158, 11, 0.25);
      border-radius: 8px;
      color: #fbbf24;
      font-size: 0.84rem;
      font-family: var(--font-mono);
      margin-bottom: 1.25rem;
    }

    .pause-banner svg {
      width: 16px;
      height: 16px;
      stroke: #fbbf24;
      fill: none;
      stroke-width: 2;
      flex-shrink: 0;
    }

    .account-badge {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.32rem 0.65rem;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 6px;
      font-family: var(--font-mono);
      font-size: 0.78rem;
      color: var(--text-secondary);
    }

    .account-badge .account-id {
      color: var(--text-main);
      font-weight: 600;
    }

    .account-badge .mode-tag {
      font-size: 0.68rem;
      padding: 0.1rem 0.35rem;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: var(--steel);
      border-radius: 3px;
      font-weight: 700;
    }

    /* Container */
    main {
      flex: 1;
      padding: 1.5rem 2rem;
      max-width: 1520px;
      margin: 0 auto;
      width: 100%;
      min-width: 0;
    }

    /* Date Filter Bar */
    .date-filter-bar {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 0.85rem 1.25rem;
      margin-bottom: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }

    .date-filter-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
    }

    .date-filter-controls-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.85rem;
      width: 100%;
    }

    .date-filter-title {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.76rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--steel-light);
    }

    .date-filter-title svg {
      width: 16px;
      height: 16px;
      stroke: var(--win);
      fill: none;
      stroke-width: 2;
    }

    .date-presets-group {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      background: rgba(255, 255, 255, 0.03);
      padding: 3px;
      border-radius: 8px;
      border: 1px solid var(--border);
    }

    .date-preset-btn {
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-secondary);
      font-family: var(--font-ui);
      font-size: 0.76rem;
      font-weight: 600;
      padding: 0.35rem 0.75rem;
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.45rem;
      transition: all 0.2s ease;
      user-select: none;
    }

    .date-preset-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.06);
    }

    .date-preset-btn.active {
      background: rgba(52, 211, 153, 0.12);
      color: #34d399;
      border-color: rgba(52, 211, 153, 0.35);
      box-shadow: 0 0 10px rgba(52, 211, 153, 0.12);
    }

    .live-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #34d399;
      box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
      display: inline-block;
      animation: pulseLive 4.5s infinite ease-in-out;
    }

    @keyframes pulseLive {
      0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px rgba(52, 211, 153, 0.8); }
      50% { opacity: 0.4; transform: scale(0.85); box-shadow: 0 0 2px rgba(52, 211, 153, 0.2); }
    }

    .date-nav-controls {
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .date-nav-arrow-btn {
      width: 32px;
      height: 32px;
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .date-nav-arrow-btn:hover:not(:disabled) {
      background: var(--bg-card-hover);
      color: var(--text-main);
      border-color: var(--border-hover);
      transform: translateY(-1px);
    }

    .date-nav-arrow-btn:disabled {
      opacity: 0.35;
      cursor: not-allowed;
    }

    .custom-date-picker {
      background: var(--bg-surface);
      color: var(--text-main);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 0.35rem 0.7rem;
      font-family: var(--font-mono);
      font-size: 0.82rem;
      font-weight: 600;
      outline: none;
      transition: all 0.2s ease;
      cursor: pointer;
      color-scheme: dark;
      height: 32px;
    }

    .custom-date-picker:focus, .custom-date-picker:hover {
      border-color: rgba(52, 211, 153, 0.45);
      box-shadow: 0 0 10px rgba(52, 211, 153, 0.12);
    }

    .date-available-chips {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      flex-wrap: wrap;
    }

    .date-chip-btn {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 0.32rem 0.65rem;
      font-family: var(--font-mono);
      font-size: 0.72rem;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    .date-chip-btn:hover {
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-main);
      border-color: var(--border-hover);
    }

    .date-chip-btn.active {
      background: rgba(52, 211, 153, 0.14);
      border-color: rgba(52, 211, 153, 0.45);
      color: #34d399;
      font-weight: 700;
    }

    .date-filter-right {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .selected-view-pill {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 0.4rem 0.85rem;
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-size: 0.78rem;
    }

    .selected-view-pill .view-status-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #34d399;
    }

    .selected-view-pill .view-title {
      color: var(--text-muted);
      font-weight: 500;
    }

    .selected-view-pill .view-date {
      color: var(--text-main);
      font-weight: 700;
      font-family: var(--font-mono);
    }

    .selected-view-pill .view-badge-count {
      background: rgba(52, 211, 153, 0.12);
      color: #34d399;
      padding: 0.15rem 0.5rem;
      border-radius: 4px;
      font-weight: 700;
      font-size: 0.72rem;
      font-family: var(--font-mono);
    }

    .table-date-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.2rem 0.6rem;
      border-radius: 5px;
      font-size: 0.74rem;
      font-weight: 700;
      background: rgba(52, 211, 153, 0.12);
      color: #34d399;
      border: 1px solid rgba(52, 211, 153, 0.3);
      margin-left: 0.5rem;
      font-family: var(--font-mono);
    }

    /* Top KPI Grid */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.85rem;
      margin-bottom: 1.5rem;
      min-width: 0;
      max-width: 100%;
    }

    .crypto-kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.85rem;
      margin-bottom: 1.5rem;
      min-width: 0;
      max-width: 100%;
      align-items: stretch;
    }

    .kpi-grid {
      align-items: stretch;
    }

    .kpi-grid .kpi-card,
    .crypto-kpi-grid .kpi-card {
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

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

    .kpi-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 1.1rem;
      display: flex;
      flex-direction: column;
      min-width: 0;
      transition: border-color 0.2s ease;
    }

    .kpi-card:hover {
      border-color: var(--border-hover);
    }

    .kpi-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.5rem;
    }

    .kpi-label {
      font-family: var(--font-ui);
      font-size: 0.76rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      font-weight: 600;
      color: var(--text-muted);
    }

    .kpi-icon {
      width: 24px;
      height: 24px;
      border-radius: 5px;
      background: rgba(255, 255, 255, 0.03);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .kpi-icon svg {
      width: 13px;
      height: 13px;
      stroke: var(--text-muted);
      fill: none;
      stroke-width: 2;
    }

    .kpi-value {
      font-family: var(--font-mono);
      font-size: clamp(1.2rem, 3.5vw, 1.5rem);
      font-weight: 700;
      color: var(--text-main);
      line-height: 1.2;
      margin-bottom: 0.35rem;
      letter-spacing: -0.03em;
      font-feature-settings: "tnum";
    }

    .kpi-footer {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.78rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
    }

    .tag-badge {
      display: inline-flex;
      align-items: center;
      padding: 0.12rem 0.45rem;
      border-radius: 4px;
      font-family: var(--font-mono);
      font-weight: 600;
      font-size: 0.74rem;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      color: var(--text-secondary);
    }

    .tag-win { color: var(--win); border-color: rgba(255, 255, 255, 0.1); }
    .tag-loss { color: var(--loss); border-color: rgba(255, 255, 255, 0.1); }

    /* Performance Panels */
    .dashboard-middle-grid {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
      margin-bottom: 1.5rem;
      min-width: 0;
      max-width: 100%;
    }

    .panel {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      min-width: 0;
      max-width: 100%;
    }

    .panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--border);
    }

    .panel-title {
      font-size: 0.98rem;
      font-weight: 700;
      letter-spacing: -0.015em;
      color: var(--text-main);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .panel-title svg {
      width: 15px;
      height: 15px;
      stroke: var(--steel);
      fill: none;
      stroke-width: 2;
    }

    .panel-subtitle {
      font-size: 0.78rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
    }

    /* Chart */
    .chart-container {
      position: relative;
      width: 100%;
      height: 200px;
    }

    #equityChart {
      width: 100%;
      height: 100%;
      display: block;
    }

    .chart-meta {
      display: flex;
      justify-content: space-between;
      margin-top: 0.75rem;
      padding-top: 0.6rem;
      border-top: 1px solid var(--border);
      font-size: 0.78rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
    }

    .chart-meta strong {
      color: var(--text-main);
    }

    /* Active Trades */
    .active-trades-container {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
      gap: 0.75rem;
      overflow-y: auto;
      max-height: 380px;
    }

    .active-trade-card {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 0.85rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .active-trade-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .trade-symbol-badge {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      font-family: var(--font-mono);
      font-weight: 600;
      font-size: 0.90rem;
    }

    .direction-badge {
      display: flex;
      align-items: center;
      gap: 0.2rem;
      padding: 0.12rem 0.45rem;
      border-radius: 3px;
      font-size: 0.74rem;
      font-weight: 600;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      color: var(--text-secondary);
    }

    .dir-call { color: var(--win); border-color: rgba(255, 255, 255, 0.1); }
    .dir-put { color: var(--loss); border-color: rgba(255, 255, 255, 0.1); }

    .direction-badge svg {
      width: 10px;
      height: 10px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2.5;
    }

    .trade-timer {
      font-family: var(--font-mono);
      font-size: 0.84rem;
      font-weight: 600;
      color: var(--steel);
      display: flex;
      align-items: center;
      gap: 0.3rem;
    }

    .trade-timer svg {
      width: 12px;
      height: 12px;
      stroke: var(--text-muted);
      fill: none;
      stroke-width: 2;
    }

    .progress-bar-bg {
      width: 100%;
      height: 3px;
      background: rgba(255, 255, 255, 0.06);
      border-radius: 2px;
      overflow: hidden;
    }

    .progress-bar-fill {
      height: 100%;
      background: var(--steel);
      border-radius: 2px;
      transition: width 1s linear;
    }

    .trade-details-grid {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.78rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
      white-space: nowrap;
      margin-bottom: 0.35rem;
    }

    .trade-details-grid strong {
      color: var(--text-main);
    }

    .trade-strategy-row {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.72rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      background: rgba(255, 255, 255, 0.03);
      padding: 0.25rem 0.45rem;
      border-radius: 4px;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .trade-strat-label {
      color: var(--text-muted);
      flex-shrink: 0;
    }

    .trade-strat-name {
      color: #93c5fd;
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .empty-state {
      grid-column: 1 / -1;
      padding: 2rem 1rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      color: var(--text-muted);
      gap: 0.4rem;
    }

    .empty-state svg {
      width: 28px;
      height: 28px;
      stroke: rgba(255, 255, 255, 0.15);
      fill: none;
      stroke-width: 1.5;
      margin-bottom: 0.2rem;
    }

    .empty-state p {
      font-size: 0.85rem;
    }

    .empty-state small {
      font-size: 0.76rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
    }

    /* Strategies Performance Grid */
    .strategies-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1rem;
      min-width: 0;
      max-width: 100%;
    }

    .strategy-table-wrap {
      width: 100%;
      grid-column: 1 / -1;
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.18);
    }

    .strategy-performance-table {
      width: 100%;
      min-width: 1040px;
      border-collapse: collapse;
    }

    .strategy-performance-table th {
      position: sticky;
      top: 0;
      z-index: 1;
      background: #111827;
      color: var(--text-muted);
      font-size: 0.68rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .strategy-performance-table td {
      font-family: var(--font-mono);
      font-size: 0.78rem;
      white-space: nowrap;
    }

    .strategy-performance-table tbody tr:hover {
      background: rgba(56, 189, 248, 0.045);
    }

    .strategy-name-cell {
      min-width: 380px;
      max-width: 580px;
      white-space: normal !important;
      word-break: break-word;
      overflow-wrap: anywhere;
      line-height: 1.35;
      color: var(--text-main);
      font-weight: 650;
    }

    .strategy-status-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.32rem;
      padding: 0.18rem 0.48rem;
      border-radius: 999px;
      color: #34d399;
      border: 1px solid rgba(52, 211, 153, 0.25);
      background: rgba(52, 211, 153, 0.08);
      font-size: 0.66rem;
      font-weight: 700;
    }

    .strategy-zero-row td:not(:first-child):not(:nth-child(2)) {
      color: var(--text-muted);
    }

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

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


    .strategy-card {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.008) 100%);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 1.15rem 1.15rem 1rem 1.15rem;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 0.8rem;
      min-width: 0;
      overflow: hidden;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    .strategy-card:hover {
      border-color: rgba(56, 189, 248, 0.3);
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }

    .strat-header-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 0.5rem;
      min-width: 0;
    }

    .strat-title-group {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      min-width: 0;
      flex: 1;
      overflow: hidden;
    }

    .strat-code-name {
      font-size: 0.84rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      color: var(--text-main);
      font-family: var(--font-mono);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }

    .strat-status-live {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.2rem 0.55rem;
      border-radius: 9999px;
      background: rgba(52, 211, 153, 0.08);
      border: 1px solid rgba(52, 211, 153, 0.22);
      color: #34d399;
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      flex-shrink: 0;
      white-space: nowrap;
    }

    .strat-status-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #34d399;
      box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
    }

    .strat-meta-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.4rem;
    }

    .strat-role-pill {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--steel);
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.07);
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      letter-spacing: 0.02em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    .strat-stake-pill {
      font-size: 0.72rem;
      font-weight: 600;
      font-family: var(--font-mono);
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.08);
      border: 1px solid rgba(56, 189, 248, 0.2);
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .strat-stake-pill small {
      color: rgba(56, 189, 248, 0.8);
      font-size: 0.70rem;
    }

    .strat-specs-box {
      background: rgba(0, 0, 0, 0.25);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 6px;
      padding: 0.6rem 0.45rem;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.25rem;
      text-align: center;
    }

    .strat-spec-item {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
      overflow: hidden;
    }

    .strat-spec-item span {
      display: block;
      color: var(--text-muted);
      font-size: 0.68rem;
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: 0.03em;
    }

    .strat-spec-item strong {
      color: var(--text-main);
      font-family: var(--font-mono);
      font-size: 0.82rem;
      font-weight: 600;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }

    .strat-metrics-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
      padding-top: 0.65rem;
      border-top: 1px solid var(--border);
    }

    .strat-metric-box {
      display: flex;
      flex-direction: column;
    }

    .strat-metric-right {
      text-align: right;
      align-items: flex-end;
    }

    .strat-metric-label {
      font-size: 0.72rem;
      color: var(--text-muted);
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: 0.04em;
    }

    .strat-metric-val {
      font-family: var(--font-mono);
      font-size: 1.35rem;
      font-weight: 700;
      line-height: 1.25;
      margin: 0.15rem 0 0.1rem 0;
    }

    .strat-metric-sub {
      font-size: 0.78rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
    }

    .strat-metric-sub strong {
      color: var(--text-main);
    }

    .strat-footer-box {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }

    .strat-progress-bar-bg {
      width: 100%;
      height: 3px;
      background: rgba(255, 255, 255, 0.06);
      border-radius: 2px;
      overflow: hidden;
    }

    .strat-progress-bar-fill {
      height: 100%;
      border-radius: 2px;
      transition: width 0.4s ease;
    }

    .strat-card-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.75rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
    }

    /* Radar Section */
    .radar-section {
      margin-bottom: 1.5rem;
    }

    .radar-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.85rem;
      flex-wrap: wrap;
      gap: 0.6rem;
    }

    .radar-tabs {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      background: rgba(255, 255, 255, 0.02);
      padding: 0.2rem;
      border-radius: 6px;
      border: 1px solid var(--border);
    }

    .tab-btn {
      font-family: var(--font-ui);
      background: transparent;
      border: none;
      padding: 0.35rem 0.75rem;
      border-radius: 4px;
      font-size: 0.80rem;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .tab-btn:hover {
      color: var(--text-main);
    }

    .tab-btn.active {
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-main);
    }

    .search-box {
      position: relative;
      display: flex;
      align-items: center;
    }

    .search-box svg {
      position: absolute;
      left: 0.6rem;
      width: 13px;
      height: 13px;
      stroke: var(--text-muted);
      fill: none;
      stroke-width: 2;
    }

    .search-input {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 0.4rem 0.75rem 0.4rem 2rem;
      font-size: 0.82rem;
      color: var(--text-main);
      font-family: var(--font-mono);
      outline: none;
      width: 190px;
      transition: border-color 0.15s ease;
    }

    .search-input:focus {
      border-color: rgba(255, 255, 255, 0.3);
    }

    .market-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
      gap: 0.75rem;
      min-width: 0;
      max-width: 100%;
    }

    .market-card {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 0.85rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      min-width: 0;
      transition: border-color 0.15s ease;
    }

    .market-card:hover {
      border-color: var(--border-hover);
    }

    .market-card.alert-call {
      border-color: rgba(52, 211, 153, 0.4);
    }
    .market-card.alert-put {
      border-color: rgba(248, 113, 113, 0.4);
    }
    .market-card.is-trigger {
      border-width: 2px;
      animation: pulseTrigger 1.5s infinite alternate;
    }
    .market-card.alert-call.is-trigger {
      border-color: rgba(52, 211, 153, 0.9);
      box-shadow: 0 0 14px rgba(52, 211, 153, 0.25);
    }
    .market-card.alert-put.is-trigger {
      border-color: rgba(248, 113, 113, 0.9);
      box-shadow: 0 0 14px rgba(248, 113, 113, 0.25);
    }
    @keyframes pulseTrigger {
      0% { transform: scale(1); }
      100% { transform: scale(1.015); }
    }

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

    .market-symbol {
      font-family: var(--font-mono);
      font-weight: 600;
      font-size: 0.92rem;
      color: var(--text-main);
    }

    .market-price {
      font-family: var(--font-mono);
      font-weight: 600;
      font-size: 0.90rem;
      color: var(--steel-light);
      transition: color 0.5s ease, text-shadow 0.5s ease;
    }
    .market-price.tick-up {
      color: var(--win, #10b981) !important;
      text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
      transition: none;
    }
    .market-price.tick-down {
      color: var(--loss, #ef4444) !important;
      text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
      transition: none;
    }

    .market-indicators-row {
      display: flex;
      justify-content: space-between;
      font-size: 0.78rem;
      font-family: var(--font-mono);
      padding: 0.35rem 0.55rem;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 5px;
      border: 1px solid rgba(255, 255, 255, 0.03);
    }

    .rsi-badge {
      font-weight: 600;
      color: var(--steel-light);
    }
    .rsi-oversold { color: var(--win); }
    .rsi-overbought { color: var(--loss); }
    .rsi-near { color: #f59e0b; }

    .band-status-pill {
      font-size: 0.72rem;
      font-family: var(--font-mono);
      padding: 0.22rem 0.45rem;
      border-radius: 4px;
      text-align: center;
      font-weight: 600;
      background: rgba(255, 255, 255, 0.02);
      color: var(--text-muted);
      border: 1px solid var(--border);
    }

    .band-status-pill.is-trigger-pill {
      font-weight: 700;
      background: rgba(255, 255, 255, 0.08);
      letter-spacing: 0.02em;
    }

    .band-status-call {
      color: var(--win);
      border-color: rgba(255, 255, 255, 0.1);
    }
    .band-status-put {
      color: var(--loss);
      border-color: rgba(255, 255, 255, 0.1);
    }

    /* ========================================================
       RADAR FOREX: TABELA INSTITUCIONAL MINIMALISTA
       ======================================================== */
    .radar-table-wrap {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: rgba(14, 18, 24, 0.55);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }

    .radar-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      text-align: left;
      font-size: 0.81rem;
      min-width: 880px;
    }

    .radar-table th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: #0d1219;
      color: var(--text-muted);
      font-family: var(--font-ui);
      font-weight: 600;
      font-size: 0.68rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 0.72rem 0.95rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      white-space: nowrap;
      user-select: none;
    }

    .radar-table td {
      padding: 0.65rem 0.95rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.035);
      color: var(--text-main);
      font-family: var(--font-mono);
      font-size: 0.81rem;
      white-space: nowrap;
      vertical-align: middle;
      font-feature-settings: "tnum";
    }

    .radar-table tbody tr {
      transition: background 0.12s ease;
    }

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

    .radar-table tbody tr.row-call-signal {
      background: rgba(16, 185, 129, 0.06);
      border-left: 3px solid var(--win);
    }

    .radar-table tbody tr.row-put-signal {
      background: rgba(239, 68, 68, 0.06);
      border-left: 3px solid var(--loss);
    }

    .radar-pair-cell {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }

    .radar-pair-symbol {
      font-weight: 700;
      font-size: 0.88rem;
      letter-spacing: 0.02em;
      color: #f1f5f9;
    }

    .radar-dot-indicator {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.2);
      flex-shrink: 0;
    }

    .radar-dot-indicator.is-call {
      background: #10b981;
      box-shadow: 0 0 8px #10b981;
      animation: pulseLive 1.5s infinite;
    }

    .radar-dot-indicator.is-put {
      background: #ef4444;
      box-shadow: 0 0 8px #ef4444;
      animation: pulseLive 1.5s infinite;
    }

    .radar-table-price {
      font-weight: 600;
      color: var(--steel-light);
      transition: color 0.5s ease;
    }

    .radar-tag-pill {
      display: inline-flex;
      align-items: center;
      padding: 0.14rem 0.45rem;
      border-radius: 4px;
      font-size: 0.74rem;
      font-weight: 600;
      font-family: var(--font-mono);
    }

    .radar-tag-pill.rsi-oversold {
      background: rgba(16, 185, 129, 0.12);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.25);
    }

    .radar-tag-pill.rsi-overbought {
      background: rgba(239, 68, 68, 0.12);
      color: #f87171;
      border: 1px solid rgba(239, 68, 68, 0.25);
    }

    .radar-tag-pill.rsi-near {
      background: rgba(245, 158, 11, 0.1);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.22);
    }

    .radar-tag-pill.rsi-neutral {
      color: var(--text-secondary);
      font-weight: 500;
    }

    .radar-bb-text {
      font-size: 0.76rem;
      font-weight: 500;
      font-family: var(--font-mono);
    }

    .radar-ema-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.2rem;
      padding: 0.12rem 0.4rem;
      border-radius: 4px;
      font-size: 0.72rem;
      font-weight: 600;
      font-family: var(--font-mono);
    }

    .radar-ema-pill.ema-up {
      background: rgba(16, 185, 129, 0.08);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.2);
    }

    .radar-ema-pill.ema-down {
      background: rgba(239, 68, 68, 0.08);
      color: #f87171;
      border: 1px solid rgba(239, 68, 68, 0.2);
    }

    .radar-wick-pill {
      display: inline-flex;
      align-items: center;
      padding: 0.12rem 0.42rem;
      border-radius: 4px;
      font-size: 0.74rem;
      font-family: var(--font-mono);
    }

    .radar-wick-pill.wick-strong {
      background: rgba(16, 185, 129, 0.12);
      color: #10b981;
      font-weight: 700;
      border: 1px solid rgba(16, 185, 129, 0.25);
    }

    .radar-wick-pill.wick-light {
      color: var(--text-muted);
      opacity: 0.85;
    }

    .radar-status-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.18rem 0.55rem;
      border-radius: 4px;
      font-size: 0.72rem;
      font-weight: 600;
      font-family: var(--font-mono);
      background: rgba(255, 255, 255, 0.025);
      color: var(--text-muted);
      border: 1px solid var(--border);
      letter-spacing: 0.01em;
    }

    .radar-status-badge.status-call {
      background: rgba(16, 185, 129, 0.14);
      color: #34d399;
      border-color: rgba(16, 185, 129, 0.35);
      font-weight: 700;
      box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
    }

    .radar-status-badge.status-put {
      background: rgba(239, 68, 68, 0.14);
      color: #f87171;
      border-color: rgba(239, 68, 68, 0.35);
      font-weight: 700;
      box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
    }

    .radar-status-badge.status-support {
      background: rgba(16, 185, 129, 0.06);
      color: #6ee7b7;
      border-color: rgba(16, 185, 129, 0.2);
    }

    .radar-status-badge.status-resistance {
      background: rgba(239, 68, 68, 0.06);
      color: #fca5a5;
      border-color: rgba(239, 68, 68, 0.2);
    }

    .radar-status-badge.status-rsi-extreme {
      background: rgba(245, 158, 11, 0.08);
      color: #fbbf24;
      border-color: rgba(245, 158, 11, 0.22);
    }

    /* Backtest Retractable Panel */
    .backtest-section {
      margin-bottom: 1.5rem;
    }

    .backtest-toggle-header {
      cursor: pointer;
      user-select: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: background 0.2s ease;
      padding: 0.9rem 1.25rem;
    }

    .backtest-toggle-header:hover {
      background: rgba(255, 255, 255, 0.02);
    }

    .panel-title-with-badge {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }

    .backtest-header-right {
      display: flex;
      align-items: center;
      gap: 0.85rem;
    }

    .backtest-summary-pill {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.35rem 0.8rem;
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      font-size: 0.80rem;
      font-family: var(--font-mono);
    }

    .btn-collapse-toggle {
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text-secondary);
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .btn-collapse-toggle:hover {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-main);
      border-color: var(--border-hover);
    }

    .btn-collapse-toggle.is-collapsed svg {
      transform: rotate(-90deg);
    }

    .backtest-collapsible-content {
      overflow: hidden;
      transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
      max-height: 1600px;
      opacity: 1;
      border-top: 1px solid var(--border);
      padding: 1.25rem;
    }

    .backtest-collapsible-content.is-collapsed {
      max-height: 0;
      opacity: 0;
      padding-top: 0;
      padding-bottom: 0;
      border-top-color: transparent;
    }

    .backtest-kpi-row {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 0.85rem;
      margin-bottom: 1.25rem;
    }

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

    .mini-kpi {
      background: rgba(0, 0, 0, 0.25);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 0.75rem 1rem;
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }

    .mini-kpi span {
      font-size: 0.74rem;
      color: var(--text-muted);
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: 0.05em;
    }

    .mini-kpi strong {
      font-size: 1.15rem;
      font-family: var(--font-mono);
      font-weight: 700;
      color: var(--text-main);
    }

    .backtest-strategy-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 0.75rem;
      margin-bottom: 1rem;
    }

    .backtest-strategy-card {
      background: rgba(255, 255, 255, 0.025);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 0.8rem 0.9rem;
    }

    .backtest-strategy-name {
      color: var(--text-main);
      font-family: var(--font-mono);
      font-size: 0.78rem;
      font-weight: 700;
      margin-bottom: 0.55rem;
      overflow-wrap: anywhere;
    }

    .backtest-strategy-metrics {
      display: flex;
      justify-content: space-between;
      gap: 0.5rem;
      color: var(--text-muted);
      font-size: 0.75rem;
    }

    .backtest-method-note {
      background: rgba(245, 158, 11, 0.07);
      border: 1px solid rgba(245, 158, 11, 0.22);
      border-radius: 7px;
      color: var(--text-secondary);
      font-size: 0.76rem;
      line-height: 1.45;
      margin-bottom: 1rem;
      padding: 0.65rem 0.8rem;
    }

    @media (max-width: 700px) {
      .backtest-strategy-grid {
        grid-template-columns: 1fr;
      }
    }

    /* Backtest Selected Scenario & Comparison */
    .scenario-highlight-card {
      background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(16, 185, 129, 0.04) 50%, rgba(15, 23, 42, 0.7));
      border: 1px solid rgba(52, 211, 153, 0.32);
      border-radius: 12px;
      padding: 1.15rem 1.35rem;
      margin-bottom: 1.25rem;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    }

    .scenario-highlight-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.95rem;
      flex-wrap: wrap;
      gap: 0.6rem;
    }

    .scenario-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      background: rgba(52, 211, 153, 0.18);
      border: 1px solid rgba(52, 211, 153, 0.42);
      color: var(--win);
      font-family: var(--font-mono);
      font-size: 0.74rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      padding: 0.35rem 0.75rem;
      border-radius: 6px;
      text-transform: uppercase;
    }

    .scenario-period-tag {
      color: var(--text-muted);
      font-family: var(--font-mono);
      font-size: 0.78rem;
    }

    .scenario-metrics-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 0.65rem;
      margin-bottom: 0.85rem;
    }

    @media (max-width: 992px) {
      .scenario-metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    @media (max-width: 600px) {
      .scenario-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    .scenario-metric-box {
      background: rgba(5, 8, 12, 0.45);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      padding: 0.7rem 0.8rem;
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }

    .scenario-metric-box span {
      font-size: 0.68rem;
      color: var(--text-muted);
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: 0.04em;
    }

    .scenario-metric-box strong {
      font-size: 1.15rem;
      font-family: var(--font-mono);
      font-weight: 700;
      color: var(--text-main);
    }

    .scenario-footer-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5rem;
      padding-top: 0.75rem;
      border-top: 1px solid rgba(255, 255, 255, 0.07);
      font-size: 0.78rem;
      color: var(--text-secondary);
      font-family: var(--font-mono);
    }

    .scenario-footer-row strong {
      color: var(--text-main);
    }

    .comparison-container {
      background: rgba(12, 17, 24, 0.75);
      border: 1px solid rgba(255, 255, 255, 0.09);
      border-radius: 12px;
      margin-bottom: 1.25rem;
      overflow: hidden;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .comparison-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.75rem 1.1rem;
      background: rgba(255, 255, 255, 0.02);
      border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .comparison-title {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      color: var(--text-main);
      font-size: 0.85rem;
      font-weight: 700;
    }

    .comparison-tag {
      font-family: var(--font-mono);
      font-size: 0.70rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .comparison-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.80rem;
    }

    .comparison-table th {
      background: rgba(18, 23, 32, 0.9);
      color: var(--text-muted);
      font-size: 0.70rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 0.7rem 0.9rem;
      text-align: left;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      white-space: nowrap;
    }

    .comparison-table td {
      padding: 0.75rem 0.9rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.04);
      font-family: var(--font-mono);
      color: var(--text-secondary);
      white-space: nowrap;
    }

    .comparison-table tr.selected-row {
      background: rgba(52, 211, 153, 0.07);
    }

    .comparison-table tr.selected-row td {
      color: var(--text-main);
      font-weight: 600;
    }

    .comparison-table tr.delta-row {
      background: rgba(5, 8, 12, 0.35);
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .comparison-table tr.delta-row td {
      font-size: 0.78rem;
    }

    /* History Table */
    .history-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.85rem;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .export-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.4rem 0.85rem;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      border-radius: 5px;
      color: var(--text-secondary);
      font-family: var(--font-ui);
      font-size: 0.80rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
    }

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

    .export-btn svg {
      width: 13px;
      height: 13px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
    }

    .history-filter-group {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      background: rgba(255, 255, 255, 0.03);
      padding: 0.2rem;
      border-radius: 6px;
      border: 1px solid var(--border);
    }

    .hist-filter-btn {
      background: transparent;
      color: var(--text-secondary);
      border: 1px solid transparent;
      font-family: var(--font-ui);
      font-size: 0.78rem;
      font-weight: 600;
      padding: 0.35rem 0.75rem;
      border-radius: 5px;
      cursor: pointer;
      transition: all 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
    }

    .hist-filter-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.06);
    }

    .hist-filter-btn.active {
      background: rgba(52, 211, 153, 0.15);
      color: #34d399;
      border-color: rgba(52, 211, 153, 0.35);
    }

    .table-container {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border: 1px solid var(--border);
      border-radius: 8px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      text-align: left;
      font-size: 0.82rem;
      min-width: 660px;
    }

    #backtestContent table {
      min-width: 720px;
    }

    th {
      padding: 0.75rem 0.95rem;
      background: rgba(255, 255, 255, 0.02);
      color: var(--text-muted);
      font-family: var(--font-ui);
      font-weight: 700;
      text-transform: uppercase;
      font-size: 0.74rem;
      letter-spacing: 0.5px;
      border-bottom: 1px solid var(--border);
    }

    td {
      padding: 0.8rem 0.95rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.03);
      color: var(--text-main);
      font-family: var(--font-mono);
      font-size: 0.82rem;
      font-feature-settings: "tnum";
    }

    tr:hover td {
      background: rgba(255, 255, 255, 0.015);
    }

    .badge-signal {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.14rem 0.45rem;
      border-radius: 4px;
      font-size: 0.74rem;
      font-weight: 600;
    }

    .win-pill {
      background: rgba(255, 255, 255, 0.03);
      color: var(--win);
      border: 1px solid var(--border);
      padding: 0.14rem 0.45rem;
      border-radius: 4px;
      font-weight: 600;
      font-size: 0.74rem;
    }

    .loss-pill {
      background: rgba(255, 255, 255, 0.03);
      color: var(--loss);
      border: 1px solid var(--border);
      padding: 0.14rem 0.45rem;
      border-radius: 4px;
      font-weight: 600;
      font-size: 0.74rem;
    }

    .profit-positive { color: var(--win); font-weight: 600; }
    .profit-negative { color: var(--loss); font-weight: 600; }

    /* Footer */
    footer {
      padding: 1rem 2rem;
      background: var(--bg-surface);
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.78rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
      margin-top: auto;
    }

    .footer-left {
      display: flex;
      align-items: center;
      gap: 1.25rem;
    }

    .footer-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }

    .footer-pill strong {
      color: var(--text-secondary);
    }

    /* Tick effect no radar: apenas o texto pisca, sem fundo translucido */
    .tick-up {
      color: #34d399 !important;
    }
    .tick-down {
      color: #f87171 !important;
    }

    /* ========================================================
       RESPONSIVIDADE INSTITUCIONAL MOBILE & TABLET
       ======================================================== */
    /* ========================================================
       DESIGN SYSTEM: NATIVE MOBILE APP OPTIMIZATION
       ======================================================== */
    /* Touch Feedback & Smooth Scrolling */
    html {
      scroll-behavior: smooth;
      -webkit-text-size-adjust: 100%;
    }

    button, input, select {
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }

    button:active {
      transform: scale(0.97);
      transition: transform 0.08s ease;
    }

    .app-section {
      scroll-margin-top: 72px;
    }

    /* Mobile Bottom Navigation Bar (Hidden on Desktop) */
    .mobile-bottom-nav {
      display: none;
    }

    @media (max-width: 900px) {
      body {
        padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
        -webkit-user-select: none;
        user-select: none;
      }

      /* Native App Header Bar */
      header {
        position: sticky;
        top: 0;
        z-index: 1000;
        padding: calc(0.55rem + env(safe-area-inset-top, 0px)) 0.85rem 0.55rem 0.85rem;
        background: rgba(14, 18, 24, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
      }

      .brand-group {
        gap: 0.5rem;
      }

      .logo-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
      }

      .logo-icon svg {
        width: 23px;
        height: 23px;
      }

      .logo-text h1 {
        font-size: 0.95rem;
      }

      .logo-text h1 span {
        display: none;
      }

      .header-actions {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        width: auto;
      }

      .engine-status-btn {
        padding: 0.38rem 0.65rem;
        font-size: 0.72rem;
        gap: 0.35rem;
        border-radius: 8px;
      }

      .engine-status-btn span#engineStatusText {
        display: none;
      }

      .account-badge {
        padding: 0.38rem 0.6rem;
        font-size: 0.72rem;
        gap: 0.35rem;
        border-radius: 8px;
      }

      .account-badge span:first-child {
        display: none;
      }

      .account-id {
        font-size: 0.72rem;
        max-width: 85px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      /* Main container touch spacing */
      main {
        padding: 0.75rem 0.75rem calc(16px + env(safe-area-inset-bottom, 0px)) 0.75rem;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
      }

      /* Date Filter Bar Mobile App Layout */
      .date-filter-bar {
        padding: 0.85rem;
        border-radius: 12px;
        margin-bottom: 0.85rem;
        gap: 0.65rem;
        display: flex;
        flex-direction: column;
        align-items: stretch;
      }

      .date-filter-header-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-bottom: 0.35rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
      }

      .date-filter-title {
        font-size: 0.74rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        color: var(--steel-light);
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }

      .date-filter-title svg {
        width: 14px;
        height: 14px;
      }

      .selected-view-pill {
        padding: 0.25rem 0.55rem;
        border-radius: 6px;
        font-size: 0.72rem;
        gap: 0.4rem;
        flex-shrink: 0;
      }

      .date-filter-controls-row {
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
        width: 100%;
      }

      .date-presets-group {
        display: flex;
        width: 100%;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border);
        border-radius: 9px;
        padding: 3px;
        gap: 3px;
      }

      .date-preset-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 0.45rem 0.2rem;
        font-size: 0.74rem;
        font-weight: 600;
        border-radius: 6px;
        white-space: nowrap;
      }

      .date-nav-controls {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.4rem;
      }

      .date-nav-arrow-btn {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        flex-shrink: 0;
      }

      .date-input-container {
        flex: 1;
      }

      .custom-date-picker {
        width: 100%;
        height: 38px;
        text-align: center;
        border-radius: 8px;
        font-size: 0.84rem;
        font-weight: 600;
        padding: 0 0.5rem;
        -webkit-appearance: none;
        appearance: none;
      }

      .date-available-chips {
        display: flex;
        width: 100%;
        gap: 0.35rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 2px 0;
      }

      .date-available-chips::-webkit-scrollbar {
        display: none;
      }

      .date-chip-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.35rem 0.65rem;
        border-radius: 6px;
        font-size: 0.72rem;
      }

      @media (max-width: 440px) {
        .selected-view-pill .view-title { display: none; }
        .date-filter-title span { font-size: 0.70rem; }
      }

      /* Top 2x2 KPI Grid (Estilo App Financeiro) */
      .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.55rem !important;
        margin-bottom: 1rem !important;
      }

      .kpi-card {
        padding: 0.75rem !important;
        border-radius: 12px !important;
      }

      .kpi-top {
        margin-bottom: 0.35rem !important;
      }

      .kpi-label {
        font-size: 0.66rem !important;
      }

      .kpi-icon {
        width: 20px !important;
        height: 20px !important;
      }

      .kpi-value {
        font-size: 1.22rem !important;
        margin-bottom: 0.25rem !important;
      }

      .kpi-footer {
        font-size: 0.68rem !important;
      }

      /* Middle Grid (Active Trades & History) */
      .dashboard-middle-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
      }

      .panel {
        border-radius: 12px !important;
        padding: 0.85rem !important;
      }

      .panel-header {
        margin-bottom: 0.75rem !important;
      }

      .panel-title {
        font-size: 0.84rem !important;
      }

      .export-btn {
        padding: 0.35rem 0.65rem !important;
        font-size: 0.72rem !important;
      }

      /* Touch-Scrollable Audit Table */
      .table-container {
        max-height: 320px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 8px !important;
        border: 1px solid var(--border);
      }

      .table-container table {
        min-width: 580px;
      }

      .table-container th, .table-container td {
        padding: 0.55rem 0.65rem !important;
        font-size: 0.76rem !important;
      }

      /* Active Trades Cards */
      .active-trade-card {
        padding: 0.75rem !important;
        border-radius: 10px !important;
      }

      .active-trade-top strong {
        font-size: 0.85rem !important;
      }

      /* Estratégias Grid */
      .strategies-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
      }

      .strategy-card {
        padding: 0.85rem !important;
        border-radius: 12px !important;
      }

      .strat-metrics-row {
        gap: 0.5rem !important;
      }

      .strat-metric-box {
        padding: 0.5rem !important;
      }

      .strat-metric-val {
        font-size: 1.1rem !important;
      }

      /* Backtest Header */
      .backtest-toggle-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        padding: 0.85rem !important;
      }

      .backtest-header-right {
        justify-content: space-between !important;
        width: 100% !important;
      }

      .backtest-summary-pill {
        font-size: 0.72rem !important;
        padding: 0.25rem 0.55rem !important;
      }

      .backtest-collapsible-content {
        padding: 0.75rem !important;
      }

      /* Radar Section & Toolbar */
      .radar-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.55rem !important;
      }

      .radar-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        display: flex !important;
        padding-bottom: 2px !important;
        width: 100% !important;
        gap: 0.3rem !important;
      }

      .radar-tabs::-webkit-scrollbar {
        display: none !important;
      }

      .tab-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 0.38rem 0.75rem !important;
        font-size: 0.74rem !important;
      }

      .search-box {
        width: 100% !important;
      }

      .search-input {
        width: 100% !important;
        height: 36px !important;
        font-size: 0.8rem !important;
      }

      .market-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
      }

      .market-card {
        padding: 0.65rem !important;
        border-radius: 10px !important;
      }

      .market-card-top strong {
        font-size: 0.84rem !important;
      }

      .market-price {
        font-size: 0.84rem !important;
      }

      .market-indicators-row {
        font-size: 0.68rem !important;
        gap: 0.3rem !important;
      }

      /* Footer */
      footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.6rem !important;
        padding: 0.85rem !important;
        margin-bottom: 1rem !important;
      }

      .footer-left {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.35rem !important;
      }

      /* Native App Bottom Tab Navigation Bar */
      .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 58px;
        background: rgba(14, 18, 24, 0.95);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        z-index: 10000;
        align-items: center;
        justify-content: space-around;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
      }

      .nav-tab-item {
        background: transparent;
        border: none;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 5px 8px;
        cursor: pointer;
        flex: 1;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        position: relative;
      }

      .nav-tab-item:active {
        transform: scale(0.92);
      }

      .nav-tab-icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .nav-tab-icon svg {
        width: 19px;
        height: 19px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        transition: all 0.2s ease;
      }

      .nav-tab-item span {
        font-size: 0.64rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        transition: color 0.2s ease;
      }

      .nav-tab-item.active {
        color: var(--win);
      }

      .nav-tab-item.active .nav-tab-icon svg {
        stroke: var(--win);
        filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.5));
      }

      .nav-tab-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 2px;
        background: var(--win);
        border-radius: 0 0 2px 2px;
        box-shadow: 0 0 8px var(--win);
      }

      .nav-badge {
        position: absolute;
        top: -4px;
        right: -8px;
        background: #34d399;
        color: #090b0f;
        font-size: 0.6rem;
        font-weight: 800;
        border-radius: 10px;
        padding: 1px 5px;
        line-height: 1;
        box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
      }
    }
    /* UI/UX refresh: operational hierarchy and clearer system states */
    body { background-color: var(--bg-base); }

    header {
      min-height: 64px;
      padding: 0.8rem clamp(1rem, 3vw, 2.5rem);
      background: rgba(9, 12, 17, 0.88);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    main {
      padding-top: 1.15rem;
    }

    .ops-overview {
      display: flex;
      align-items: stretch;
      justify-content: space-between;
      gap: 1rem;
      margin-bottom: 1rem;
      padding: 1rem 1.1rem;
      border: 1px solid rgba(52, 211, 153, 0.14);
      border-radius: 14px;
      background: linear-gradient(135deg, rgba(52, 211, 153, 0.075), rgba(18, 23, 32, 0.92) 38%);
      box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    }

    .ops-overview-copy {
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-width: 210px;
    }

    .ops-eyebrow {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      color: var(--win);
      font: 700 0.68rem/1 var(--font-mono);
      letter-spacing: 0.09em;
      text-transform: uppercase;
      margin-bottom: 0.45rem;
    }

    .ops-eyebrow::before {
      content: '';
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--win);
      box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.11), 0 0 14px rgba(52, 211, 153, 0.65);
    }

    .ops-overview h2 {
      font-size: clamp(1.15rem, 2vw, 1.45rem);
      line-height: 1.2;
      letter-spacing: -0.035em;
      margin-bottom: 0.3rem;
    }

    .ops-overview-copy p {
      color: var(--text-muted);
      font-size: 0.76rem;
      font-family: var(--font-mono);
    }

    .ops-config-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(92px, 1fr));
      gap: 0.5rem;
      flex: 1;
      max-width: 800px;
    }

    .ops-config-item {
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-height: 66px;
      padding: 0.65rem 0.75rem;
      border: 1px solid rgba(255, 255, 255, 0.065);
      border-radius: 10px;
      background: rgba(5, 8, 12, 0.34);
    }

    .ops-config-item span {
      color: var(--text-muted);
      font-size: 0.63rem;
      font-weight: 700;
      letter-spacing: 0.065em;
      text-transform: uppercase;
      margin-bottom: 0.25rem;
    }

    .ops-config-item strong {
      color: var(--text-main);
      font: 700 0.92rem/1.2 var(--font-mono);
      white-space: nowrap;
    }

    .ops-config-item strong em {
      color: var(--text-muted);
      font-size: 0.66rem;
      font-style: normal;
      font-weight: 500;
    }

    .date-filter-bar,
    .panel,
    .kpi-card {
      border-color: rgba(255, 255, 255, 0.075);
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
    }

    .date-filter-bar {
      padding: 0.8rem 1rem;
      box-shadow: none;
    }

    .kpi-card {
      position: relative;
      overflow: hidden;
      padding: 1.15rem;
      min-height: 126px;
    }

    .kpi-card::after {
      content: '';
      position: absolute;
      inset: auto 0 0 0;
      height: 2px;
      background: rgba(255, 255, 255, 0.04);
    }

    .kpi-card.is-positive::after { background: var(--win); }
    .kpi-card.is-negative::after { background: var(--loss); }
    .kpi-card.is-loading .kpi-value { color: var(--text-muted); }

    .kpi-value {
      font-size: clamp(1.45rem, 2.6vw, 1.82rem);
      margin-top: auto;
    }

    .kpi-footer {
      min-height: 22px;
    }

    .dashboard-middle-grid .panel:first-child .active-trades-container:has(.empty-state) {
      max-height: none;
    }

    .dashboard-middle-grid .panel:first-child .empty-state {
      min-height: 72px;
      padding: 0.75rem;
      border: 1px dashed rgba(255, 255, 255, 0.075);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.012);
    }

    .table-container {
      background: rgba(5, 8, 12, 0.22);
    }

    .table-container thead th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: #151b24;
    }

    tbody tr {
      transition: background-color 0.16s ease;
    }

    tbody tr:hover td {
      background: rgba(52, 211, 153, 0.025);
    }

    .strategy-card,
    .market-card {
      transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
    }

    .strategy-card:hover,
    .market-card:hover {
      transform: translateY(-2px);
      border-color: rgba(52, 211, 153, 0.2);
    }

    .sync-dot {
      display: inline-block;
      width: 6px;
      height: 6px;
      margin-right: 0.35rem;
      border-radius: 50%;
      background: var(--win);
      box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
      vertical-align: middle;
    }

    @media (max-width: 980px) {
      .ops-overview { flex-direction: column; }
      .ops-config-grid { max-width: none; }
    }

    @media (max-width: 640px) {
      .logo-text h1 {
        font-size: 0.78rem !important;
        white-space: nowrap;
      }

      .brand-logo { gap: 0.45rem; }
      .account-badge .mode-tag { display: none; }
      .account-id { max-width: 78px; font-size: 0.66rem; }

      .ops-overview {
        margin-bottom: 0.75rem;
        padding: 0.85rem;
        border-radius: 12px;
      }

      .ops-overview-copy { min-width: 0; }
      .ops-overview h2 { font-size: 1.08rem; }
      .ops-overview-copy p { font-size: 0.68rem; }

      .ops-config-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
      }

      .ops-config-item {
        min-height: 56px;
        padding: 0.55rem;
      }

      .ops-config-item span { font-size: 0.56rem; }
      .ops-config-item strong { font-size: 0.8rem; }
      .ops-config-item:nth-child(4),
      .ops-config-item:nth-child(5) { grid-column: span 1; }

      .kpi-card { min-height: 112px; }
      .kpi-value { font-size: 1.35rem !important; }
      .panel-subtitle { line-height: 1.5; }

      #section-strategies .panel-header,
      #section-radar .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
      }

      #section-strategies .panel-subtitle,
      #section-radar .panel-subtitle {
        width: 100%;
      }
    }

    /* ========================================================
       DASHBOARD MODE SWITCHER (MINIMALIST SEGMENTED CONTROL)
       ======================================================== */
    .dashboard-switcher {
      display: inline-flex;
      align-items: center;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 7px;
      padding: 2px;
      gap: 2px;
      box-shadow: none;
    }

    .dash-tab {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0.30rem 0.85rem;
      border-radius: 5px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-family: var(--font-ui);
      font-size: 0.80rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
      white-space: nowrap;
    }

    .dash-tab:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.04);
    }

    .dash-tab.active,
    .dash-tab.active#btnSwitchCrypto {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
      border: none;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    }

    /* Views */
    .dashboard-view {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      width: 100%;
      animation: fadeInView 0.25s ease-out;
    }

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

    /* ========================================================
       CRYPTO DASHBOARD SPECIFIC STYLES
       ======================================================== */
    .crypto-hero-banner {
      background: linear-gradient(135deg, rgba(26, 20, 10, 0.85) 0%, rgba(14, 18, 24, 0.95) 60%, rgba(20, 15, 8, 0.9) 100%);
      border: 1px solid rgba(245, 158, 11, 0.25);
      border-radius: 16px;
      padding: 1.5rem 2rem;
      position: relative;
      overflow: hidden;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(245, 158, 11, 0.15);
    }

    .crypto-hero-banner::after {
      content: '';
      position: absolute;
      top: -50px;
      right: -50px;
      width: 250px;
      height: 250px;
      background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
      pointer-events: none;
    }

    .crypto-hero-content {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1.5rem;
      flex-wrap: wrap;
      position: relative;
      z-index: 1;
    }

    .crypto-hero-title-group h2 {
      font-size: 1.5rem;
      font-weight: 800;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 0.65rem;
      letter-spacing: -0.02em;
    }

    .crypto-hero-title-group p {
      color: #cbd5e1;
      font-size: 0.88rem;
      margin-top: 0.35rem;
      max-width: 650px;
      line-height: 1.45;
    }

    .crypto-live-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(245, 158, 11, 0.15);
      border: 1px solid rgba(245, 158, 11, 0.35);
      color: #fbbf24;
      font-size: 0.72rem;
      font-weight: 800;
      padding: 0.25rem 0.65rem;
      border-radius: 9999px;
      letter-spacing: 0.05em;
    }

    .crypto-live-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #f59e0b;
      box-shadow: 0 0 8px #f59e0b;
      animation: pulseCryptoDot 1.8s infinite;
    }

    @keyframes pulseCryptoDot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.4; transform: scale(0.85); }
    }

    .crypto-hero-pills {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .crypto-hero-pill {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      padding: 0.5rem 0.85rem;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .crypto-hero-pill span {
      font-size: 0.65rem;
      color: var(--text-muted);
      text-transform: uppercase;
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .crypto-hero-pill strong {
      font-size: 0.95rem;
      font-family: var(--font-mono);
      color: #f8fafc;
      font-weight: 700;
    }

    /* Live Ticker Cards (BTC & ETH) */
    .crypto-tickers-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 1.25rem;
    }

    .crypto-ticker-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 1.35rem 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
      position: relative;
      overflow: hidden;
      transition: all 0.25s ease;
    }

    .crypto-ticker-card:hover {
      border-color: rgba(245, 158, 11, 0.3);
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

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

    .ticker-asset-info {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .ticker-icon-box {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 1.25rem;
    }

    .ticker-icon-box.btc {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
      border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .ticker-icon-box.eth {
      background: rgba(99, 102, 241, 0.15);
      color: #818cf8;
      border: 1px solid rgba(99, 102, 241, 0.3);
    }

    .ticker-name-box h3 {
      font-size: 1.05rem;
      font-weight: 700;
      color: #fff;
    }

    .ticker-name-box span {
      font-size: 0.72rem;
      color: var(--text-muted);
      font-family: var(--font-mono);
    }

    .ticker-price-row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
    }

    .ticker-price-val {
      font-size: 2rem;
      font-weight: 800;
      font-family: var(--font-mono);
      letter-spacing: -0.02em;
      color: #fff;
      transition: color 0.3s ease;
    }

    .ticker-indicators-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.5rem;
      background: rgba(255, 255, 255, 0.025);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      padding: 0.65rem 0.75rem;
    }

    .ticker-stat-item {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .ticker-stat-item span {
      font-size: 0.65rem;
      color: var(--text-muted);
      font-weight: 600;
      text-transform: uppercase;
    }

    .ticker-stat-item strong {
      font-size: 0.85rem;
      font-family: var(--font-mono);
      color: #f1f5f9;
    }

    /* Quartet Strategy Cards Grid */
    .crypto-quartet-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 1.15rem;
    }

    .crypto-strat-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 1.25rem 1.35rem;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 1rem;
      position: relative;
      transition: all 0.22s ease;
    }

    .crypto-strat-card:hover {
      border-color: rgba(255, 255, 255, 0.16);
      transform: translateY(-2px);
    }

    .crypto-strat-card.rank-1 {
      border-color: rgba(245, 158, 11, 0.4);
      background: linear-gradient(145deg, rgba(245, 158, 11, 0.04) 0%, var(--bg-surface) 100%);
    }

    .crypto-strat-card.rank-2 {
      border-color: rgba(52, 211, 153, 0.35);
      background: linear-gradient(145deg, rgba(52, 211, 153, 0.04) 0%, var(--bg-surface) 100%);
    }

    .crypto-strat-card.rank-6 {
      border-color: rgba(56, 189, 248, 0.35);
      background: linear-gradient(145deg, rgba(56, 189, 248, 0.04) 0%, var(--bg-surface) 100%);
    }

    .crypto-strat-card.rank-8 {
      border-color: rgba(168, 85, 247, 0.35);
      background: linear-gradient(145deg, rgba(168, 85, 247, 0.04) 0%, var(--bg-surface) 100%);
    }

    .crypto-rank-badge {
      font-size: 0.65rem;
      font-weight: 800;
      font-family: var(--font-mono);
      padding: 0.15rem 0.45rem;
      border-radius: 4px;
      letter-spacing: 0.04em;
      white-space: nowrap !important;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      line-height: 1.2;
    }

    .crypto-rank-badge.rank-1,
    .crypto-strat-card.rank-1 .crypto-rank-badge {
      background: rgba(245, 158, 11, 0.15);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.35);
    }

    .crypto-rank-badge.rank-2,
    .crypto-strat-card.rank-2 .crypto-rank-badge {
      background: rgba(52, 211, 153, 0.15);
      color: #34d399;
      border: 1px solid rgba(52, 211, 153, 0.35);
    }

    .crypto-rank-badge.rank-6,
    .crypto-strat-card.rank-6 .crypto-rank-badge {
      background: rgba(56, 189, 248, 0.15);
      color: #38bdf8;
      border: 1px solid rgba(56, 189, 248, 0.35);
    }

    .crypto-rank-badge.rank-8,
    .crypto-strat-card.rank-8 .crypto-rank-badge {
      background: rgba(168, 85, 247, 0.15);
      color: #c084fc;
      border: 1px solid rgba(168, 85, 247, 0.35);
    }

    .crypto-strat-metrics {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.65rem;
      padding: 0.75rem;
      background: rgba(255, 255, 255, 0.025);
      border-radius: 10px;
    }

    .crypto-strat-formula {
      font-size: 0.73rem;
      color: var(--text-secondary);
      background: rgba(0, 0, 0, 0.25);
      padding: 0.5rem 0.65rem;
      border-radius: 8px;
      font-family: var(--font-mono);
      line-height: 1.4;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* 100k Explorer Table */
    .crypto-explorer-container {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }

    .crypto-filter-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1rem;
      flex-wrap: wrap;
    }

    .crypto-filter-pills {
      display: flex;
      gap: 0.4rem;
      flex-wrap: wrap;
    }

    .crypto-pill-btn {
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      color: var(--text-secondary);
      padding: 0.38rem 0.85rem;
      border-radius: 8px;
      font-size: 0.76rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.18s ease;
    }

    .crypto-pill-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.08);
    }

    .crypto-pill-btn.active {
      background: rgba(245, 158, 11, 0.18);
      border-color: rgba(245, 158, 11, 0.4);
      color: #fbbf24;
      font-weight: 700;
    }

    .crypto-search-box {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 0.4rem 0.85rem;
      min-width: 240px;
    }

    .crypto-search-box input {
      background: transparent;
      border: none;
      color: #fff;
      font-family: var(--font-ui);
      font-size: 0.8rem;
      outline: none;
      width: 100%;
    }

    .crypto-table-wrapper {
      overflow-x: auto;
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 10px;
    }

    .crypto-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.78rem;
    }

    .crypto-table th {
      background: rgba(255, 255, 255, 0.03);
      padding: 0.75rem 1rem;
      text-align: left;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      font-size: 0.68rem;
      letter-spacing: 0.04em;
      border-bottom: 1px solid var(--border);
    }

    .crypto-table td {
      padding: 0.7rem 1rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.04);
      color: var(--text-main);
      font-family: var(--font-ui);
    }

    .crypto-table tr:hover td {
      background: rgba(255, 255, 255, 0.02);
    }

    /* Accessibility, operational feedback and responsive data presentation */
    .sr-only {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      padding: 0 !important;
      margin: -1px !important;
      overflow: hidden !important;
      clip: rect(0, 0, 0, 0) !important;
      white-space: nowrap !important;
      border: 0 !important;
    }

    button:focus-visible,
    input:focus-visible,
    [tabindex]:focus-visible {
      outline: 2px solid #5eead4;
      outline-offset: 3px;
    }

    .header-sync-meta {
      display: inline-flex;
      align-items: center;
      color: var(--text-muted);
      font: 600 0.67rem/1 var(--font-mono);
      white-space: nowrap;
    }

    .header-sync-meta.is-offline { color: #fca5a5; }
    .header-sync-meta.is-stale { color: #fbbf24; }
    .header-sync-meta.is-online { color: #a7f3d0; }

    #pnlCard,
    #cryptoPnlCard {
      border: 1px solid var(--border);
      background: var(--bg-card);
    }

    .mobile-table-hint {
      display: none;
      color: var(--text-muted);
      font-size: 0.75rem;
      margin-bottom: 0.55rem;
    }

    .confirm-overlay {
      position: fixed;
      inset: 0;
      z-index: 20000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 1rem;
      background: rgba(2, 6, 12, 0.76);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    .confirm-overlay.is-open { display: flex; }

    .confirm-dialog {
      width: min(420px, 100%);
      padding: 1.25rem;
      border: 1px solid rgba(248, 113, 113, 0.28);
      border-radius: 14px;
      background: #121720;
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    }

    .confirm-dialog h2 {
      margin-bottom: 0.45rem;
      font-size: 1.05rem;
    }

    .confirm-dialog p {
      color: var(--text-secondary);
      font-size: 0.86rem;
      line-height: 1.55;
    }

    .confirm-dialog-actions {
      display: flex;
      justify-content: flex-end;
      gap: 0.65rem;
      margin-top: 1.1rem;
    }

    .dialog-btn {
      min-height: 40px;
      padding: 0.55rem 0.9rem;
      border: 1px solid var(--border-hover);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.04);
      color: var(--text-main);
      font: 700 0.78rem/1 var(--font-ui);
      cursor: pointer;
    }

    .dialog-btn-danger {
      border-color: rgba(248, 113, 113, 0.35);
      background: rgba(248, 113, 113, 0.12);
      color: #fecaca;
    }

    .dialog-btn-success {
      border-color: rgba(52, 211, 153, 0.35);
      background: rgba(52, 211, 153, 0.12);
      color: #a7f3d0;
    }

    .toast-region {
      position: fixed;
      top: 78px;
      right: 1rem;
      z-index: 21000;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      pointer-events: none;
    }

    .toast {
      width: min(360px, calc(100vw - 2rem));
      padding: 0.75rem 0.9rem;
      border: 1px solid var(--border-hover);
      border-radius: 10px;
      background: rgba(18, 23, 32, 0.98);
      color: var(--text-main);
      box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
      font-size: 0.8rem;
    }

    .toast.success { border-color: rgba(52, 211, 153, 0.35); }
    .toast.error { border-color: rgba(248, 113, 113, 0.4); }

    @media (max-width: 900px) {
      body {
        -webkit-user-select: text;
        user-select: text;
      }

      button,
      input,
      .nav-tab-item {
        -webkit-user-select: none;
        user-select: none;
      }

      header {
        display: grid;
        grid-template-columns: auto 1fr auto;
      }

      .dashboard-switcher { justify-self: center; }
      .header-sync-meta { display: none; }

      .engine-status-btn {
        min-width: 42px;
        min-height: 38px;
        justify-content: center;
      }

      .account-badge { display: none; }

      .empty-state {
        min-height: 58px !important;
        padding: 0.7rem !important;
      }

      .mobile-table-hint {
        display: block;
      }
    }

    @media (max-width: 640px) {
      .kpi-label { font-size: 0.72rem !important; }
      .kpi-footer { font-size: 0.74rem !important; }
      .panel-subtitle { font-size: 0.73rem !important; }
      .nav-tab-item span { font-size: 0.7rem; }

      .table-container {
        max-height: 440px !important;
        overflow-x: hidden !important;
        background: transparent;
        border: 0;
      }

      .table-container table,
      .table-container tbody {
        display: block;
        width: 100%;
        min-width: 0;
      }

      .table-container thead { display: none; }

      .table-container tr.history-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        margin-bottom: 0.65rem;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.018);
        overflow: hidden;
      }

      .table-container tr.history-row td {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.55rem 0.65rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.045);
        font-size: 0.78rem !important;
        overflow-wrap: anywhere;
      }

      .table-container tr.history-row td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font: 700 0.64rem/1.2 var(--font-ui);
        letter-spacing: 0.045em;
        text-transform: uppercase;
      }

      .table-container tr.history-row td:nth-child(5) {
        grid-column: 1 / -1;
      }

      .table-container tr.empty-history-row {
        display: block;
      }

      .table-container tr.empty-history-row td {
        display: block;
        width: 100%;
        text-align: center;
      }

      .panel-header {
        align-items: flex-start !important;
        gap: 0.55rem;
      }

      .panel-title { min-width: 0; }
      .table-date-badge { white-space: normal; }

      .toast-region {
        top: 70px;
        left: 0.75rem;
        right: 0.75rem;
      }

      .toast { width: 100%; }
    }

    /* ========================================================
       TRADING LAB 3.0 — PREMIUM OPERATIONAL DASHBOARD
       ======================================================== */
    :root {
      --mode-accent: #e5e7eb;
      --surface-raised: #202227;
      --surface-soft: rgba(255, 255, 255, 0.035);
    }

    body[data-dashboard-mode="crypto"] { --mode-accent: #f59e0b; }

    body { background-color: var(--bg-base); }

    header {
      border-bottom-color: rgba(255, 255, 255, 0.08);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }

    .header-actions { gap: 0.65rem; }

    .engine-status-btn {
      min-height: 48px;
      gap: 0.75rem;
      padding: 0.55rem 0.6rem 0.55rem 0.9rem;
      border-radius: 12px;
      border-color: rgba(255, 255, 255, 0.1);
      background: linear-gradient(145deg, #24262c, #1c1d22);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 3px 10px rgba(0, 0, 0, 0.15);
      color: var(--text-main);
    }

    .engine-status-btn:hover:not(:disabled) {
      border-color: rgba(255, 255, 255, 0.2);
      background: linear-gradient(145deg, #2a2d34, #202228);
      transform: none;
    }

    .engine-status-btn:focus-visible {
      outline: 2px solid var(--steel);
      outline-offset: 3px;
    }

    .engine-status-btn .status-dot {
      flex-shrink: 0;
      width: 6px;
      height: 6px;
    }

    .engine-status-btn .status-dot:not(.dot-paused):not(.dot-offline):not(.dot-stale):not(.dot-connecting) {
      box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.08);
    }

    .engine-status-btn .engine-action-badge {
      min-height: 28px;
      gap: 0.35rem;
      margin-left: 0.35rem;
      padding: 0.3rem 0.55rem;
      border-radius: 7px;
      border-color: rgba(255, 255, 255, 0.065);
      background: rgba(255, 255, 255, 0.035);
      color: var(--text-secondary);
      font-size: 0.67rem;
      font-weight: 500;
    }

    .engine-status-btn:not(.is-paused):hover .engine-action-badge {
      border-color: rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.07);
      color: var(--text-main);
    }

    .engine-status-btn:disabled {
      cursor: not-allowed;
      opacity: 0.74;
      transform: none;
    }

    .engine-copy {
      display: flex;
      min-width: 118px;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.25rem;
      text-align: left;
    }

    .engine-copy strong {
      color: var(--text-main);
      font: 600 0.75rem/1.2 var(--font-ui);
    }

    .engine-copy small {
      color: var(--text-muted);
      font: 400 0.64rem/1.2 var(--font-ui);
      font-variant-numeric: tabular-nums;
    }

    .engine-copy small.is-offline { color: #fca5a5; }
    .engine-copy small.is-stale { color: #fbbf24; }
    .engine-copy small.is-online { color: var(--text-muted); }

    .account-badge {
      min-height: 42px;
      border-color: rgba(255, 255, 255, 0.055);
      background: rgba(255, 255, 255, 0.022);
    }

    main { max-width: 1580px; }

    .dashboard-view { gap: 1rem; }

    .date-filter-bar {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      padding: 0.62rem 0.75rem;
      margin-bottom: 0.9rem;
      border-color: rgba(255, 255, 255, 0.05);
      background: rgba(14, 18, 24, 0.72);
      box-shadow: none;
    }

    .date-filter-header-row { width: auto; }
    .date-filter-controls-row { width: auto; flex-wrap: nowrap; }
    .date-input-container { min-width: 0; position: relative; }
    .date-input-container .custom-date-picker { color: transparent; }
    .date-display-br {
      position: absolute;
      inset: 1px 2rem 1px 1px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-surface);
      border-radius: 6px;
      color: var(--text-main);
      font: 600 0.84rem var(--font-mono);
      pointer-events: none;
    }
    .date-input-container:focus-within {
      outline: 2px solid var(--mode-accent, #34d399);
      outline-offset: 2px;
      border-radius: 6px;
    }
    .custom-date-picker { min-width: 0; }

    @media (min-width: 1181px) {
      .kpi-grid,
      .crypto-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }

      #pnlCard,
      #cryptoPnlCard {
        grid-column: span 1;
      }
    }

    .kpi-grid,
    .crypto-kpi-grid {
      gap: 0.7rem;
      margin-bottom: 0.75rem;
    }

    .kpi-card {
      min-height: 132px;
      padding: 1rem;
      border: 1px solid var(--border);
      background: var(--bg-card);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .kpi-card:hover {
      border-color: var(--border-hover);
      background: var(--bg-card-hover);
    }

    #pnlCard,
    #cryptoPnlCard,
    #synthPnlCard {
      min-height: 132px;
      border: 1px solid var(--border);
      background: var(--bg-card);
    }

    #pnlCard:not(.is-positive):not(.is-negative),
    #cryptoPnlCard:not(.is-positive):not(.is-negative),
    #synthPnlCard:not(.is-positive):not(.is-negative) {
      border: 1px solid var(--border);
      background: var(--bg-card);
    }

    #pnlCard.is-positive,
    #cryptoPnlCard.is-positive,
    #synthPnlCard.is-positive {
      border-color: rgba(16, 185, 129, 0.35);
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02) 65%), var(--bg-card);
    }

    #pnlCard.is-negative,
    #cryptoPnlCard.is-negative,
    #synthPnlCard.is-negative {
      border-color: rgba(244, 63, 94, 0.35);
      background: linear-gradient(135deg, rgba(244, 63, 94, 0.08), rgba(244, 63, 94, 0.02) 65%), var(--bg-card);
    }

    .tag-neutral {
      color: var(--text-secondary);
      border-color: rgba(148, 163, 184, 0.16);
      background: rgba(148, 163, 184, 0.07);
    }

    .kpi-label {
      text-transform: none;
      letter-spacing: -0.01em;
      font-size: 0.78rem;
    }

    .kpi-value {
      position: relative;
      z-index: 2;
      letter-spacing: -0.045em;
    }

    #pnlCard .kpi-value,
    #cryptoPnlCard .kpi-value {
      font-size: clamp(1.45rem, 2.4vw, 1.82rem);
      text-shadow: 0 0 28px rgba(52, 211, 153, 0.12);
    }

    .kpi-footer {
      position: relative;
      z-index: 2;
      font-size: 0.72rem;
    }

    .kpi-icon { display: none; }




    .panel,
    .crypto-ticker-card,
    .market-card,
    .strategy-card {
      border-color: rgba(255, 255, 255, 0.055);
      box-shadow: none;
    }

    .panel { border-radius: 13px; }
    .panel-header { border-bottom-color: rgba(255, 255, 255, 0.055); }
    .panel-title { font-size: 0.92rem; }
    .empty-state { padding: 1rem; }

    .active-trades-container {
      grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    }

    .dashboard-middle-grid .panel:first-child .empty-state {
      min-height: 62px;
      border-style: solid;
      background: rgba(255, 255, 255, 0.016);
    }

    .table-container { border-color: rgba(255, 255, 255, 0.045); }

    #crypto-section-overview { order: 1; }
    #crypto-section-trades { order: 2; }
    #crypto-section-market { order: 3; }
    #crypto-section-strategies { order: 4; }

    body[data-dashboard-mode="crypto"] .dash-tab.active { color: #fde68a; }
    body[data-dashboard-mode="forex"] .dash-tab.active { color: #bfdbfe; }

    @media (max-width: 1180px) {
      .kpi-grid,
      .crypto-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      }

      #balanceCard,
      #cryptoBalanceCard,
      #pnlCard,
      #cryptoPnlCard {
        grid-column: auto;
      }
    }

    @media (max-width: 900px) {
      header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.55rem 0.7rem;
      }

      .brand-group { grid-column: 1; grid-row: 1; }
      .dashboard-switcher { grid-column: 2; grid-row: 1; justify-self: end; }
      .header-actions { grid-column: 1 / -1; grid-row: 2; width: 100%; }

      .engine-status-btn {
        width: 100%;
        min-height: 44px;
        justify-content: flex-start;
      }

      .engine-copy { flex: 1; }
      .engine-action-badge { margin-left: auto; }
      .account-badge { display: none; }

      .date-filter-bar {
        flex-direction: column;
        align-items: stretch;
      }

      .date-filter-header-row { width: 100%; }
      .date-filter-controls-row { width: 100%; }

      .date-nav-arrow-btn,
      .custom-date-picker { min-height: 44px; }


      .mobile-table-hint { display: none; }
      .active-trades-container { grid-template-columns: 1fr; }
    }

    @media (max-width: 460px) {
      main { padding-inline: 0.65rem; }

      .logo-text h1 { font-size: 0.76rem !important; }
      .logo-icon { width: 30px; height: 30px; }
      .dash-tab { min-height: 38px; padding-inline: 0.7rem; }

      .date-filter-title span { font-size: 0.68rem; }
      .date-filter-controls-row { min-width: 0; }
      .date-presets-group,
      .date-nav-controls { min-width: 0; }
      .date-nav-controls { flex: 1; }
      .date-input-container { min-width: 0; flex: 1; }
      .custom-date-picker { width: 100%; padding-inline: 0.25rem; }

      .kpi-grid,
      .crypto-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
      }

      #pnlCard,
      #cryptoPnlCard {
        grid-column: auto;
        min-height: 116px;
      }

      .kpi-card { min-height: 116px; padding: 0.72rem !important; }
      .kpi-label { font-size: 0.72rem !important; line-height: 1.25; }
      .kpi-value { font-size: 1.28rem !important; }
      #pnlCard .kpi-value,
      #cryptoPnlCard .kpi-value { font-size: 1.28rem !important; }
      .kpi-footer { font-size: 0.7rem !important; line-height: 1.3; flex-wrap: wrap; }



      .panel-header { flex-wrap: wrap; }
      .panel-title { flex-wrap: wrap; line-height: 1.35; }
      .panel-subtitle { margin-left: auto; }

      .mobile-bottom-nav { height: 64px; }
      .nav-tab-item { min-width: 64px; min-height: 48px; }
    }

    /* ========================================================
       UX & ACCESSIBILITY LAYER
       ======================================================== */
    :root {
      --control-min-height: 40px;
      --focus-ring: #7dd3fc;
    }

    :where(button, input, select, [tabindex]):focus-visible {
      outline: 2px solid var(--focus-ring) !important;
      outline-offset: 3px;
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.55rem;
    }
    .account-badge { display: none !important; }

    .engine-status-summary {
      min-height: 46px;
      display: inline-flex;
      align-items: center;
      gap: 0.7rem;
      padding: 0.52rem 0.85rem;
      border: 1px solid rgba(255, 255, 255, 0.09);
      border-radius: 11px;
      background: linear-gradient(145deg, #1c1c1f, #141416);
    }

    .engine-control-btn {
      min-height: 40px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.45rem;
      padding: 0.55rem 0.75rem;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 9px;
      background: rgba(255, 255, 255, 0.04);
      color: var(--text-secondary);
      font: 600 0.78rem var(--font-ui);
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    }

    .engine-control-btn:hover:not(:disabled) {
      color: #fecaca;
      border-color: rgba(248, 113, 113, 0.35);
      background: rgba(248, 113, 113, 0.1);
    }

    .engine-control-btn.is-paused {
      color: #6ee7b7;
      border-color: rgba(52, 211, 153, 0.3);
      background: rgba(52, 211, 153, 0.09);
    }

    .engine-control-btn:disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }

    .connection-banner {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      min-height: 52px;
      margin-bottom: 0.85rem;
      padding: 0.7rem 0.8rem;
      border: 1px solid rgba(251, 191, 36, 0.28);
      border-radius: 11px;
      background: rgba(120, 53, 15, 0.18);
      color: #fde68a;
    }

    .connection-banner[hidden] { display: none; }
    .connection-banner.is-offline {
      border-color: rgba(248, 113, 113, 0.3);
      background: rgba(127, 29, 29, 0.18);
      color: #fecaca;
    }
    .connection-banner-icon {
      display: grid;
      place-items: center;
      width: 26px;
      height: 26px;
      flex: 0 0 26px;
      border: 1px solid currentColor;
      border-radius: 50%;
      font-weight: 800;
    }
    .connection-banner-copy {
      display: flex;
      min-width: 0;
      flex: 1;
      flex-direction: column;
      gap: 0.1rem;
      font-size: 0.82rem;
    }
    .connection-banner-copy span { color: var(--text-secondary); }
    .connection-banner button,
    .backtest-retry-btn {
      min-height: var(--control-min-height);
      padding: 0.5rem 0.8rem;
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.07);
      color: var(--text-main);
      font: 700 0.8rem var(--font-ui);
      cursor: pointer;
    }

    .kpi-label,
    .kpi-footer,
    .panel-subtitle,
    .table-date-badge,
    .footer-pill,
    .control-label {
      font-size: 0.8125rem !important;
    }

    .kpi-card.is-loading .kpi-value { color: transparent !important; }
    .kpi-card.is-loading .kpi-value::after {
      content: '';
      display: block;
      width: 42%;
      height: 1.5rem;
      margin-top: 0.15rem;
      border-radius: 6px;
      background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
      background-size: 220% 100%;
      animation: skeleton-slide 1.2s linear infinite;
    }
    @keyframes skeleton-slide { to { background-position: -220% 0; } }

    .date-preset-btn,
    .hist-filter-btn,
    .tab-btn,
    .export-btn,
    .dash-tab,
    .search-input,
    #cryptoSortSelect {
      min-height: 36px;
      font-size: 0.8125rem !important;
    }

    #cryptoSortSelect {
      padding: 0.45rem 0.65rem;
      border: 1px solid var(--border);
      border-radius: 7px;
      background: var(--bg-card);
      color: var(--text-main);
      font-family: var(--font-ui);
    }

    .control-label {
      color: var(--text-secondary);
      font-weight: 700;
    }

    .strategy-performance-table th,
    .strategy-performance-table td,
    .table-container th,
    .table-container td {
      font-size: 0.8125rem !important;
      line-height: 1.45;
    }

    .table-sort-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.2rem;
      width: 100%;
      min-height: 36px;
      padding: 0.25rem;
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      text-transform: inherit;
      cursor: pointer;
    }

    .backtest-state {
      display: flex;
      min-height: 340px;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 0.7rem;
      padding: 2rem;
      text-align: center;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--bg-surface);
    }
    .backtest-state h2 { font-size: 1.05rem; }
    .backtest-state p { max-width: 520px; color: var(--text-secondary); font-size: 0.9rem; }
    .backtest-state-icon {
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      border: 1px solid currentColor;
      border-radius: 50%;
      color: var(--mode-accent);
      font-size: 1.2rem;
    }
    .backtest-state-icon.is-spinning { animation: state-spin 0.9s linear infinite; }
    @keyframes state-spin { to { transform: rotate(360deg); } }
    .backtest-tabs {
      display: flex;
      gap: 0.4rem;
      overflow-x: auto;
      padding-bottom: 0.5rem;
      margin-bottom: 1.5rem;
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    #viewBacktest table,
    #viewBacktest button { font-size: 0.8125rem !important; }

    @media (max-width: 900px) {
      header {
        padding: calc(0.4rem + env(safe-area-inset-top, 0px)) 0.65rem 0.4rem;
        gap: 0.35rem 0.55rem;
      }
      .header-actions { gap: 0.4rem; }
      .engine-status-summary {
        min-height: 42px;
        flex: 1;
        padding: 0.42rem 0.65rem;
      }
      .engine-control-btn {
        min-width: 44px;
        min-height: 44px;
      }
      .engine-copy strong { font-size: 0.78rem; }
      .engine-copy small { font-size: 0.72rem; }

      .date-preset-btn,
      .hist-filter-btn,
      .tab-btn,
      .export-btn,
      .dash-tab,
      .search-input,
      #cryptoSortSelect,
      .dialog-btn,
      .backtest-retry-btn {
        min-height: 44px !important;
      }

      .connection-banner {
        align-items: flex-start;
        flex-wrap: wrap;
      }
      .connection-banner button { width: 100%; min-height: 44px; }

      .strategy-card .strat-card-footer,
      .strategy-card .strat-metric-label,
      .market-indicators-row,
      .ticker-stat-item span {
        font-size: 0.78rem !important;
      }
      body[data-dashboard-mode="backtest"] { padding-bottom: 0; }
      body[data-dashboard-mode="backtest"] .mobile-bottom-nav { display: none !important; }
    }

    @media (max-width: 460px) {
      .logo-text { display: none; }
      .brand-group { min-width: 30px; }
      .dashboard-switcher { justify-self: stretch; }
      .dash-tab { min-width: 0; padding-inline: 0.58rem; }
      .header-actions { min-width: 0; }
      .engine-copy { min-width: 0; }
      .engine-copy small {
        overflow: hidden;
        max-width: 190px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .engine-control-btn { padding-inline: 0.65rem; }
      .engine-control-btn span { display: none; }
      .kpi-label,
      .kpi-footer { font-size: 0.78rem !important; }
      .backtest-state { min-height: 280px; padding: 1.25rem; }
      .backtest-overview-grid,
      .backtest-analysis-grid { grid-template-columns: 1fr !important; }
      #viewBacktest button { min-height: 44px; }
    }

    /* ========================================================
       SINTÉTICOS LAB 24/7 DEDICATED STYLES
       ======================================================== */
    .synth-hero-banner {
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(14, 165, 233, 0.03) 50%, rgba(99, 102, 241, 0.06) 100%);
      border: 1px solid rgba(56, 189, 248, 0.22);
      border-radius: 14px;
      padding: 1.15rem 1.4rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 1rem;
      position: relative;
      overflow: hidden;
    }
    .synth-hero-banner::before {
      content: '';
      position: absolute;
      top: -40px;
      right: -40px;
      width: 140px;
      height: 140px;
      background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, transparent 70%);
      pointer-events: none;
    }
    .synth-hero-title-group {
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
    }
    .synth-hero-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-family: var(--font-mono);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.3);
      padding: 0.2rem 0.65rem;
      border-radius: 9999px;
      width: fit-content;
    }
    .synth-hero-title {
      font-size: 1.35rem;
      font-weight: 800;
      color: #ffffff;
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 0.6rem;
    }
    .synth-hero-desc {
      font-size: 0.85rem;
      color: var(--text-secondary);
      line-height: 1.4;
    }
    .synth-meta-badges {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      flex-wrap: wrap;
    }
    .synth-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-family: var(--font-mono);
      font-size: 0.75rem;
      font-weight: 600;
      padding: 0.35rem 0.75rem;
      border-radius: 8px;
      background: var(--bg-surface);
      border: 1px solid var(--border);
      color: var(--text-main);
    }
    .synth-badge-accent {
      background: rgba(56, 189, 248, 0.12);
      border-color: rgba(56, 189, 248, 0.35);
      color: #38bdf8;
    }
    .synth-badge-payout {
      background: rgba(52, 211, 153, 0.12);
      border-color: rgba(52, 211, 153, 0.35);
      color: var(--win);
    }

    /* Setups Campeões Cards Grid */
    .synth-setups-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 1rem;
      margin-top: 0.5rem;
    }
    .synth-setup-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1.15rem;
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      position: relative;
      transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    }
    .synth-setup-card:hover {
      border-color: rgba(56, 189, 248, 0.35);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
      transform: translateY(-2px);
    }
    .synth-setup-card.champion-1 {
      border-color: rgba(251, 191, 36, 0.4);
      background: linear-gradient(180deg, rgba(251, 191, 36, 0.04) 0%, var(--bg-card) 45%);
    }
    .synth-setup-card.champion-2 {
      border-color: rgba(148, 163, 184, 0.4);
      background: linear-gradient(180deg, rgba(148, 163, 184, 0.04) 0%, var(--bg-card) 45%);
    }
    .synth-setup-card.champion-3 {
      border-color: rgba(56, 189, 248, 0.4);
      background: linear-gradient(180deg, rgba(56, 189, 248, 0.04) 0%, var(--bg-card) 45%);
    }
    .synth-setup-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 0.5rem;
    }
    .synth-setup-badge-rank {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-family: var(--font-mono);
      font-size: 0.72rem;
      font-weight: 700;
      padding: 0.2rem 0.55rem;
      border-radius: 6px;
      text-transform: uppercase;
    }
    .rank-gold {
      background: rgba(251, 191, 36, 0.15);
      border: 1px solid rgba(251, 191, 36, 0.4);
      color: #fbbf24;
    }
    .rank-silver {
      background: rgba(203, 213, 225, 0.15);
      border: 1px solid rgba(203, 213, 225, 0.4);
      color: #e2e8f0;
    }
    .rank-cyan {
      background: rgba(56, 189, 248, 0.15);
      border: 1px solid rgba(56, 189, 248, 0.4);
      color: #38bdf8;
    }
    .synth-setup-name {
      font-size: 1.05rem;
      font-weight: 700;
      color: #ffffff;
      margin-top: 0.2rem;
    }
    .synth-setup-role {
      font-size: 0.8rem;
      color: var(--text-secondary);
      line-height: 1.35;
    }
    .synth-setup-metrics {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.5rem;
      background: rgba(0, 0, 0, 0.25);
      padding: 0.65rem 0.75rem;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.04);
    }
    .synth-metric-box {
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
    }
    .synth-metric-lbl {
      font-size: 0.68rem;
      color: var(--text-muted);
      text-transform: uppercase;
      font-weight: 600;
    }
    .synth-metric-val {
      font-family: var(--font-mono);
      font-size: 0.92rem;
      font-weight: 700;
      color: var(--text-main);
    }
    .synth-metric-val.win {
      color: var(--win);
    }
    .synth-setup-details {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      font-size: 0.78rem;
    }
    .synth-detail-row {
      display: flex;
      justify-content: space-between;
      gap: 0.5rem;
      border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
      padding-bottom: 0.3rem;
    }
    .synth-detail-key {
      color: var(--text-muted);
    }
    .synth-detail-val {
      font-family: var(--font-mono);
      color: var(--steel-light);
      font-weight: 500;
      text-align: right;
    }
    .synth-setup-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: auto;
      padding-top: 0.5rem;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
      font-size: 0.75rem;
    }
    .synth-live-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--win);
      font-weight: 600;
    }

    /* Radar Synthetics Cards & Table */
    .synth-radar-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
      gap: 1.25rem;
    }
    .synth-radar-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
      position: relative;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .synth-radar-card:hover {
      border-color: rgba(56, 189, 248, 0.35);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }
    .synth-radar-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--border);
    }
    .synth-radar-title-box {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .synth-radar-icon {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #38bdf8;
      font-weight: 800;
      font-family: var(--font-mono);
      font-size: 0.85rem;
    }
    .synth-radar-price-box {
      text-align: right;
    }
    .synth-radar-price {
      font-family: var(--font-mono);
      font-size: 1.35rem;
      font-weight: 700;
      color: var(--text-main);
      transition: color 0.3s ease;
    }
    .synth-radar-indicators-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.75rem;
    }
    .synth-ind-panel {
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.04);
      border-radius: 8px;
      padding: 0.65rem 0.8rem;
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }
    .synth-ind-header {
      display: flex;
      justify-content: space-between;
      font-size: 0.72rem;
      color: var(--text-muted);
      font-weight: 600;
      text-transform: uppercase;
    }
    .synth-ind-values {
      font-family: var(--font-mono);
      font-size: 0.82rem;
      color: var(--steel-light);
    }
    .synth-signal-box {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.75rem 1rem;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid var(--border);
    }
    .synth-signal-alert {
      background: rgba(52, 211, 153, 0.12) !important;
      border-color: rgba(52, 211, 153, 0.4) !important;
      color: var(--win) !important;
      font-weight: 700 !important;
    }
    .synth-signal-put {
      background: rgba(248, 113, 113, 0.12) !important;
      border-color: rgba(248, 113, 113, 0.4) !important;
      color: var(--loss) !important;
      font-weight: 700 !important;
    }
  /* Shared visual system for the Forex and Synthetics dashboards. */
:root {
  --bg-base: #101114;
  --bg-surface: #15161a;
  --bg-card: #1a1c21;
  --bg-card-hover: #202228;
  --bg-inset: #131418;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(255, 255, 255, 0.25);
  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --mode-accent: #f3f4f6;
  --win: #10b981;
  --loss: #f43f5e;
}
body[data-dashboard-mode="synthetics"] { --mode-accent: #10b981; }
body { background: var(--bg-base); color: var(--text-main); }
header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 3rem);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.brand-group { gap: .65rem; }
.brand-mark { display: none !important; }
.logo-text h1 { font-size: .95rem; letter-spacing: .04em; font-weight: 800; color: #f9fafb; }
.header-actions { justify-self: end; }
.dashboard-switcher { background: var(--bg-inset); padding: 4px; border-radius: 10px; border: 1px solid var(--border); display: inline-flex; align-items: center; gap: 4px; }
.dash-tab { border-radius: 7px; font-weight: 600; color: var(--text-secondary); transition: all 0.15s ease; border: 1px solid transparent; }
.dash-tab:hover { color: var(--text-main); }
#btnSwitchForex {
  color: #ffffff !important;
  background: transparent;
  border: 1px solid transparent;
}
#btnSwitchForex:hover {
  background: rgba(16, 185, 129, 0.12);
  color: #ffffff !important;
}
#btnSwitchForex.active {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #ffffff !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25) !important;
}
#btnSwitchSynthetics {
  color: #ffffff !important;
  background: transparent;
  border: 1px solid transparent;
}
#btnSwitchSynthetics:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #ffffff !important;
}
#btnSwitchSynthetics.active {
  background: rgba(56, 189, 248, 0.22) !important;
  color: #ffffff !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.25) !important;
}
.engine-status-summary { background: var(--bg-card); border: 1px solid var(--border); box-shadow: none; }
main { width: 100%; max-width: 1540px; padding: 1.5rem clamp(1rem, 3vw, 2.5rem); }
.workspace-heading { display: none !important; }
.dashboard-view { gap: 1.35rem; }
.app-section { min-width: 0; scroll-margin-top: 110px; }
.date-filter-bar { border-radius: 12px; padding: .8rem 1rem; background: var(--bg-surface); border: 1px solid var(--border); margin-bottom: 1rem; }
.date-filter-title { color: var(--text-secondary); }
.date-filter-title span { text-transform: none; letter-spacing: 0; }
.date-preset-btn.active, .tab-btn.active, .hist-filter-btn.active { background: #262830; color: var(--text-main); border: 1px solid rgba(255, 255, 255, 0.12); }
.kpi-grid { gap: 1rem; }
.kpi-card { padding: 1.35rem !important; min-height: 156px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-card); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); transition: all 0.15s ease; }
.kpi-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); border-color: var(--border-hover); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.kpi-top { margin-bottom: .9rem; }
.kpi-label { font-weight: 500; color: var(--text-secondary); }
.kpi-value { font-family: var(--font-ui); font-size: clamp(1.65rem, 2.4vw, 2.15rem) !important; font-weight: 600; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1.3; color: #f9fafb; }
.kpi-footer { padding-top: .9rem; margin-top: .65rem; border-top: 1px solid var(--border); }
:is(#pnlCard, #cryptoPnlCard, #synthPnlCard),
:is(#pnlCard, #cryptoPnlCard, #synthPnlCard):not(.is-positive):not(.is-negative) {
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}
:is(#pnlCard, #cryptoPnlCard, #synthPnlCard).is-positive { border-color: rgba(16, 185, 129, 0.35) !important; background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02) 65%), var(--bg-card) !important; }
:is(#pnlCard, #cryptoPnlCard, #synthPnlCard).is-negative { border-color: rgba(244, 63, 94, 0.35) !important; background: linear-gradient(135deg, rgba(244, 63, 94, 0.08), rgba(244, 63, 94, 0.02) 65%), var(--bg-card) !important; }
.panel { padding: 1.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
.panel-header { padding-bottom: 1rem; margin-bottom: 1rem; gap: .75rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.panel-title { font-weight: 600; font-size: .95rem; letter-spacing: -.015em; color: #f9fafb; }
.empty-state { border: 1px dashed rgba(255, 255, 255, 0.12); border-radius: 10px; background: var(--bg-inset); color: var(--text-secondary); }
.table-container, .radar-table-wrap, .strategy-table-wrap { background: var(--bg-inset); border: 1px solid var(--border); border-radius: 10px; scrollbar-width: thin; scrollbar-color: #383b45 var(--bg-inset); }
.strategy-performance-table th, .radar-table th, .table-container th { background: var(--bg-surface); color: var(--text-secondary); font-size: .69rem !important; font-weight: 600; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.strategy-performance-table td, .radar-table td, .table-container td { border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-block: .9rem; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.strategy-performance-table td:first-child, .radar-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-card); border-right: 1px solid var(--border); }
.strategy-performance-table th:first-child, .radar-table th:first-child { position: sticky; left: 0; z-index: 3; background: var(--bg-surface); }
.search-input { background: var(--bg-inset); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; color: #f9fafb; }
.search-input:focus { border-color: var(--border-focus); outline: none; }
.radar-toolbar { gap: .75rem; }
.market-grid, .synth-setups-grid, .synth-radar-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)) !important; gap: 0.85rem !important; }
.market-card, .pair-card, .strategy-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; transition: all 0.15s ease; padding: 0.85rem 1rem !important; }
.market-card:hover, .pair-card:hover, .strategy-card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
footer { background: var(--bg-surface); color: var(--text-muted); border-top: 1px solid var(--border); }
.footer-left { gap: 1.5rem; }
.skip-link { position: fixed; top: -80px; left: 1rem; z-index: 300; padding: .75rem 1rem; color: #f3f4f6; background: #262830; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
@media (max-width: 1100px) {
  header { grid-template-columns: 1fr auto; }
  .header-actions { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
  .app-section { scroll-margin-top: 155px; }
}
@media (max-width: 700px) {
  header { padding: .65rem .85rem; gap: .65rem; }
  .brand-group { grid-column: 1; grid-row: 1; }
  .dashboard-switcher { grid-column: 2; grid-row: 1; }
  .header-actions { grid-row: 2; }
  .logo-text { display: block; }
  .logo-text h1 { font-size: .75rem !important; }
  .brand-mark { display: none; }
  main { padding: 1.25rem .85rem; }
  .workspace-heading { margin-bottom: 1.15rem; }
  .workspace-heading p { font-size: .8rem; }
  .workspace-nav { display: none; }
  .kpi-grid { gap: .65rem !important; }
  .kpi-card { padding: .95rem !important; min-height: 147px !important; }
  .kpi-value { font-size: clamp(1.2rem, 5vw, 1.7rem) !important; overflow-wrap: anywhere; }
  .kpi-label { font-size: .75rem !important; line-height: 1.4; }
  .kpi-footer { gap: .35rem; font-size: .72rem !important; flex-wrap: wrap; }
  .panel { padding: 1rem .85rem; }
  .date-filter-bar { padding: .85rem; }
  .date-filter-controls-row { flex-wrap: wrap; gap: .7rem; }
  .date-presets-group, .date-nav-controls { width: 100%; flex: 1 0 100%; }
  .date-presets-group button { flex: 1; }
  .date-input-container { flex: 1; }
  .custom-date-picker { width: 100%; }
  .date-nav-arrow-btn { min-width: 44px; }
  .radar-toolbar, .radar-toolbar-left, .radar-toolbar-right { flex-wrap: wrap; width: 100%; min-width: 0; }
  .search-box { width: 100%; min-width: 0; }
  .search-input { width: 100%; min-width: 0; font-size: 16px !important; }
  .strategies-grid { grid-template-columns: 1fr !important; gap: 0.75rem !important; }
  .market-grid { grid-template-columns: 1fr !important; gap: 0.75rem !important; }
  .mobile-bottom-nav { background: var(--bg-surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .nav-tab-item { min-height: 60px; }
  .nav-tab-item.active { color: var(--mode-accent); }
  footer { padding-bottom: 5rem; }
}
@media (max-width: 360px) {
  header { grid-template-columns: 1fr; }
  .brand-group { display: none; }
  .dashboard-switcher { grid-column: 1; justify-self: stretch; }
  .dash-tab { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}