﻿/* ==========================================================================
   BoTrade.ai - Trade Monitor Frontend Dashboard Styles
   Premium dark-themed trading dashboard with 3D effects, glassmorphism,
   and modern interactive UI. Self-contained - overrides any active theme.
   Optimized for Core Web Vitals & PageSpeed 100/100.
   ========================================================================== */

/* ---- Fonts loaded via <link> in template head (no @import to avoid render-blocking) ---- */

/* ---- CSS Custom Properties ---- */
:root {
    --ftm-bg: #0a0e1a;
    --ftm-bg-secondary: #0f1629;
    --ftm-bg-card: #141b2d;
    --ftm-bg-card-hover: #1a2340;
    --ftm-bg-elevated: #1e2742;
    --ftm-surface: rgba(20, 27, 45, .85);
    --ftm-border: rgba(255, 255, 255, .06);
    --ftm-border-light: rgba(255, 255, 255, .1);
    --ftm-text: #e2e8f0;
    --ftm-text-secondary: #94a3b8;
    --ftm-text-muted: #64748b;
    --ftm-accent: #3b82f6;
    --ftm-accent-glow: rgba(59, 130, 246, .3);
    --ftm-green: #10b981;
    --ftm-green-glow: rgba(16, 185, 129, .25);
    --ftm-red: #ef4444;
    --ftm-red-glow: rgba(239, 68, 68, .25);
    --ftm-yellow: #f59e0b;
    --ftm-purple: #8b5cf6;
    --ftm-cyan: #06b6d4;
    --ftm-pink: #ec4899;
    --ftm-radius: 16px;
    --ftm-radius-sm: 10px;
    --ftm-radius-xs: 6px;
    --ftm-glass: rgba(255, 255, 255, .03);
    --ftm-glass-border: rgba(255, 255, 255, .08);
    --ftm-shadow-card: 0 4px 24px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255, 255, 255, .05);
    --ftm-shadow-glow: 0 0 30px rgba(59, 130, 246, .1);
    --ftm-transition: .25s cubic-bezier(.4, 0, .2, 1);
    --ftm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ftm-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ---- Global Reset for FTM Pages ---- */
body.ftm-dashboard-page,
body.ftm-dashboard-page.ftm-template-body {
    margin: 0 !important;
    padding: 0 !important;
    background: #0a0e1a !important;
    background: var(--ftm-bg) !important;
    color: var(--ftm-text) !important;
    font-family: var(--ftm-font) !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    line-height: 1.6 !important;
}

body.ftm-dashboard-page *,
body.ftm-dashboard-page *::before,
body.ftm-dashboard-page *::after {
    box-sizing: border-box !important;
}

/* ---- Dashboard Container ---- */
.ftm-dashboard {
    max-width: 1920px;
    margin: 0 auto;
    padding: 24px clamp(16px, 2vw, 40px);
    position: relative;
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
}

/* ---- Background Effects ---- */
.ftm-dashboard::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, .08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, .06) 0%, transparent 50%),
                radial-gradient(ellipse at 40% 80%, rgba(16, 185, 129, .04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    will-change: auto;
}

.ftm-dashboard > * {
    position: relative;
    z-index: 1;
}

/* ---- Loading Overlay ---- */
.ftm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ftm-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity .3s ease;
}

.ftm-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.ftm-loader {
    text-align: center;
}

.ftm-loader-ring {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px;
    animation: ftmLoaderBounce 1.4s infinite ease-in-out both;
}

.ftm-loader-ring:nth-child(1) {
    background: var(--ftm-accent);
    animation-delay: -.32s;
}

.ftm-loader-ring:nth-child(2) {
    background: var(--ftm-green);
    animation-delay: -.16s;
}

.ftm-loader-ring:nth-child(3) {
    background: var(--ftm-purple);
}

.ftm-loader p {
    color: var(--ftm-text-secondary);
    font-size: 14px;
    margin-top: 24px;
    letter-spacing: .5px;
}

@keyframes ftmLoaderBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ---- Status Bar ---- */
.ftm-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(14,20,36,.94), rgba(20,27,50,.90));
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--ftm-radius);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 14px;
    position: relative;
    overflow: visible;
    animation: ftmBarEntrance .6s cubic-bezier(.22,1,.36,1) both;
}

/* Animated gradient shimmer line (top edge) */
.ftm-status-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(16,185,129,.0) 8%,
        rgba(16,185,129,.55) 28%,
        rgba(6,182,212,.65) 50%,
        rgba(139,92,246,.55) 72%,
        rgba(16,185,129,.0) 92%,
        transparent 100%);
    background-size: 200% 100%;
    animation: ftmShimmerLine 4s linear infinite;
    opacity: 0;
    transition: opacity .6s;
    border-radius: var(--ftm-radius) var(--ftm-radius) 0 0;
    z-index: 2;
}
.ftm-status-bar.ftm-status-online::before { opacity: 1; }

/* Soft ambient glow when online */
.ftm-status-bar::after {
    content: '';
    position: absolute;
    top: -20%; left: 0;
    width: 100%; height: 140%;
    background: radial-gradient(ellipse at 15% 50%, rgba(16,185,129,.06) 0%, transparent 55%);
    pointer-events: none;
    opacity: 0;
    transition: opacity .8s;
    border-radius: var(--ftm-radius);
    z-index: 0;
}
.ftm-status-bar.ftm-status-online::after { opacity: 1; }

@keyframes ftmBarEntrance {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes ftmShimmerLine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Status Hero (left section) ---- */
.ftm-status-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
    min-width: 0;
    animation: ftmHeroEntrance .5s .1s cubic-bezier(.22,1,.36,1) both;
}

@keyframes ftmHeroEntrance {
    0% { opacity: 0; transform: translateX(-12px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* â”€â”€â”€ Live Badge (pulse + credential label) â”€â”€â”€ */
.ftm-status-live-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 10px;
    background: linear-gradient(135deg, rgba(16,185,129,.1) 0%, rgba(6,182,212,.06) 100%);
    border: 1px solid rgba(16,185,129,.15);
    border-radius: 100px;
    position: relative;
    animation: ftmBadgeEntrance .5s .15s cubic-bezier(.22,1,.36,1) both;
    transition: border-color .5s, background .5s;
}

/* Online state enhances the badge */
.ftm-status-online .ftm-status-live-badge {
    border-color: rgba(16,185,129,.22);
    background: linear-gradient(135deg, rgba(16,185,129,.12) 0%, rgba(6,182,212,.07) 100%);
}

/* Offline state dims the badge */
.ftm-status-offline .ftm-status-live-badge {
    border-color: rgba(239,68,68,.15);
    background: linear-gradient(135deg, rgba(239,68,68,.06) 0%, rgba(239,68,68,.03) 100%);
}

@keyframes ftmBadgeEntrance {
    0% { opacity: 0; transform: scale(.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* â”€â”€â”€ Pulse Ring (animated status dot) â”€â”€â”€ */
.ftm-pulse-ring {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ftm-pulse-core {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ftm-text-muted);
    position: relative;
    z-index: 2;
    transition: background .5s cubic-bezier(.22,1,.36,1), box-shadow .5s cubic-bezier(.22,1,.36,1);
}

/* Online state */
.ftm-pulse-ring.online .ftm-pulse-core {
    background: #34d399;
    box-shadow: 0 0 10px rgba(16,185,129,.5), 0 0 3px rgba(16,185,129,.8);
    animation: ftmCoreGlow 2.5s ease-in-out infinite;
}

.ftm-pulse-ring.online::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(16,185,129,.35);
    animation: ftmRingExpand 2.5s ease-out infinite;
}

.ftm-pulse-ring.online::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid rgba(16,185,129,.18);
    animation: ftmRingExpand 2.5s .7s ease-out infinite;
}

/* Offline state */
.ftm-pulse-ring.offline .ftm-pulse-core {
    background: #f87171;
    box-shadow: 0 0 8px rgba(239,68,68,.35);
    animation: ftmCoreGlowRed 3s ease-in-out infinite;
}

@keyframes ftmCoreGlowRed {
    0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,.35); }
    50% { box-shadow: 0 0 14px rgba(239,68,68,.5), 0 0 4px rgba(239,68,68,.7); }
}

@keyframes ftmCoreGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(16,185,129,.5), 0 0 3px rgba(16,185,129,.8); }
    50% { box-shadow: 0 0 18px rgba(16,185,129,.6), 0 0 5px rgba(16,185,129,.9), 0 0 35px rgba(16,185,129,.15); }
}

@keyframes ftmRingExpand {
    0% { transform: scale(.65); opacity: .8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* â”€â”€â”€ Credential Label (name badge) â”€â”€â”€ */
.ftm-cred-label {
    font-size: 13.5px;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    letter-spacing: .4px;
    text-transform: capitalize;
    text-shadow: 0 1px 8px rgba(255,255,255,.08);
    transition: color .4s, text-shadow .4s;
}

/* â”€â”€â”€ Status Info (text + uptime) â”€â”€â”€ */
.ftm-status-info {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: ftmInfoEntrance .5s .25s cubic-bezier(.22,1,.36,1) both;
}

@keyframes ftmInfoEntrance {
    0% { opacity: 0; transform: translateX(-8px); }
    100% { opacity: 1; transform: translateX(0); }
}

.ftm-status-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--ftm-text);
    white-space: nowrap;
    transition: color .4s, text-shadow .4s;
}

.ftm-status-text.ftm-text-running {
    color: #34d399;
    text-shadow: 0 0 24px rgba(16,185,129,.2), 0 0 6px rgba(16,185,129,.1);
}

.ftm-status-text.ftm-text-stopped {
    color: #f87171;
    text-shadow: 0 0 24px rgba(239,68,68,.15), 0 0 6px rgba(239,68,68,.08);
}

/* Reveal animation on status text change */
.ftm-status-text.ftm-status-reveal {
    animation: ftmStatusReveal .45s cubic-bezier(.22,1,.36,1);
}

@keyframes ftmStatusReveal {
    0% { opacity: 0; transform: translateY(8px) scale(.97); filter: blur(4px); }
    60% { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Vertical divider */
.ftm-status-divider {
    width: 1px;
    height: 18px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,.15), transparent);
    flex-shrink: 0;
    opacity: .8;
}

/* â”€â”€â”€ Uptime Badge â”€â”€â”€ */
.ftm-uptime-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 100px;
    font-family: var(--ftm-mono);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ftm-text-secondary);
    white-space: nowrap;
    transition: color .4s, background .4s, border-color .4s, box-shadow .4s;
}

.ftm-uptime-badge svg {
    opacity: .6;
    flex-shrink: 0;
    transition: opacity .4s, color .4s;
}

.ftm-uptime-badge.ftm-uptime-active {
    color: var(--ftm-cyan);
    border-color: rgba(6,182,212,.18);
    background: linear-gradient(135deg, rgba(6,182,212,.1), rgba(139,92,246,.05));
    box-shadow: 0 0 12px rgba(6,182,212,.06);
}

.ftm-uptime-badge.ftm-uptime-active svg {
    opacity: 1;
    color: var(--ftm-cyan);
    animation: ftmClockSpin 8s linear infinite;
}

@keyframes ftmClockSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ftm-uptime-value {
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: opacity .3s;
}

.ftm-status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Tab Navigation in Status Bar ---- */
.ftm-status-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    animation: ftmTabsEntrance .5s .2s cubic-bezier(.22,1,.36,1) both;
}

@keyframes ftmTabsEntrance {
    0% { opacity: 0; transform: translateX(12px); }
    100% { opacity: 1; transform: translateX(0); }
}

.ftm-tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ftm-text-secondary);
    text-decoration: none;
    transition: color 0.25s, background 0.25s, border-color 0.25s, transform 0.2s, box-shadow 0.3s;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
/* Ripple effect on tab tap (all viewports) */
.ftm-tab-link .ftm-tab-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 212, 170, 0.2);
    transform: scale(0);
    animation: ftmTabRipple 0.5s ease-out forwards;
    pointer-events: none;
}
.ftm-tab-link svg {
    opacity: 0.55;
    transition: opacity 0.25s, transform 0.25s, color 0.25s;
}
.ftm-tab-link:hover {
    color: var(--ftm-text);
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,.08);
    transform: translateY(-1px);
}
.ftm-tab-link:hover svg {
    opacity: 0.9;
    transform: scale(1.08);
}
.ftm-tab-link.active {
    color: #00d4aa;
    background: linear-gradient(135deg, rgba(0,212,170,0.12), rgba(99,102,241,0.07));
    border-color: rgba(0,212,170,0.25);
    font-weight: 600;
    box-shadow: 0 0 16px rgba(0,212,170,0.08), 0 0 6px rgba(0,212,170,0.04) inset;
    animation: ftmTabGlowPulse 3s ease-in-out infinite;
}
.ftm-tab-link.active svg {
    opacity: 1;
    color: #00d4aa;
}

/* ---- Tab Panels ---- */
.ftm-tab-panel {
    display: none;
}
.ftm-tab-panel.active {
    display: block;
    animation: ftmPanelEnter 0.4s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes ftmPanelEnter {
    from { opacity: 0; transform: translateY(16px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Tab Content Cards ---- */
.ftm-tab-content-card {
    background: var(--ftm-surface);
    border: 1px solid var(--ftm-glass-border);
    border-radius: var(--ftm-radius);
    padding: clamp(20px, 2.5vw, 36px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    box-sizing: border-box;
}
.ftm-tab-content-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ftm-border);
}
.ftm-tab-content-header svg {
    color: var(--ftm-accent);
    flex-shrink: 0;
}
.ftm-tab-content-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--ftm-text);
}
.ftm-about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}
.ftm-tab-meta {
    margin-top: 16px;
    font-size: 12px;
    color: var(--ftm-text-muted);
    font-style: italic;
}
/* About content (rich editor output) */
.ftm-about-content {
    color: var(--ftm-text);
    font-size: 15px;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.ftm-about-content h1,
.ftm-about-content h2,
.ftm-about-content h3,
.ftm-about-content h4,
.ftm-about-content h5,
.ftm-about-content h6 {
    color: var(--ftm-text);
    font-weight: 700;
    margin: 1.4em 0 0.6em;
    line-height: 1.3;
}
.ftm-about-content h1 { font-size: 28px; }
.ftm-about-content h2 { font-size: 24px; }
.ftm-about-content h3 { font-size: 20px; }
.ftm-about-content h4 { font-size: 17px; }
.ftm-about-content h5 { font-size: 15px; }
.ftm-about-content h6 { font-size: 13px; color: var(--ftm-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.ftm-about-content h1:first-child,
.ftm-about-content h2:first-child,
.ftm-about-content h3:first-child,
.ftm-about-content h4:first-child,
.ftm-about-content h5:first-child,
.ftm-about-content h6:first-child {
    margin-top: 0;
}
.ftm-about-content p {
    margin: 0 0 1em;
    color: var(--ftm-text-secondary, var(--ftm-text));
}
.ftm-about-content a {
    color: var(--ftm-accent);
    text-decoration: underline;
    text-decoration-color: rgba(0, 212, 170, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}
.ftm-about-content a:hover {
    text-decoration-color: var(--ftm-accent);
}
.ftm-about-content strong,
.ftm-about-content b {
    font-weight: 700;
    color: var(--ftm-text);
}
.ftm-about-content em,
.ftm-about-content i {
    font-style: italic;
}
.ftm-about-content ul,
.ftm-about-content ol {
    margin: 0 0 1em;
    padding-left: 1.8em;
}
.ftm-about-content ul { list-style-type: disc; }
.ftm-about-content ol { list-style-type: decimal; }
.ftm-about-content li {
    margin-bottom: 0.4em;
    color: var(--ftm-text-secondary, var(--ftm-text));
}
.ftm-about-content li::marker {
    color: var(--ftm-accent);
}
.ftm-about-content blockquote {
    margin: 1em 0;
    padding: 16px 20px;
    border-left: 4px solid var(--ftm-accent);
    background: rgba(0, 212, 170, 0.04);
    border-radius: 0 var(--ftm-radius) var(--ftm-radius) 0;
    color: var(--ftm-text-secondary, var(--ftm-text));
    font-style: italic;
}
.ftm-about-content blockquote p:last-child {
    margin-bottom: 0;
}
.ftm-about-content hr {
    border: none;
    border-top: 1px solid var(--ftm-border);
    margin: 1.5em 0;
}
.ftm-about-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ftm-radius);
    margin: 1em 0;
    border: 1px solid var(--ftm-glass-border);
}
.ftm-about-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 14px;
}
.ftm-about-content table th,
.ftm-about-content table td {
    padding: 10px 14px;
    border: 1px solid var(--ftm-border);
    text-align: left;
}
.ftm-about-content table th {
    background: rgba(255,255,255,0.04);
    font-weight: 600;
    color: var(--ftm-text);
}
.ftm-about-content table td {
    color: var(--ftm-text-secondary, var(--ftm-text));
}
.ftm-about-content table tr:hover td {
    background: rgba(255,255,255,0.02);
}
.ftm-about-content code {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Fira Code', 'Courier New', monospace;
    color: var(--ftm-accent);
}
.ftm-about-content pre {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--ftm-border);
    border-radius: var(--ftm-radius);
    padding: 16px 20px;
    overflow-x: auto;
    margin: 1em 0;
}
.ftm-about-content pre code {
    background: none;
    padding: 0;
    color: var(--ftm-text);
    font-size: 13px;
    line-height: 1.6;
}
/* About empty state */
.ftm-about-empty {
    padding: 48px 24px;
    text-align: center;
}
.ftm-about-empty p {
    color: var(--ftm-text-muted);
    font-size: 15px;
    font-style: italic;
    margin: 0;
}
/* Support links */
.ftm-support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.ftm-support-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}
.ftm-support-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--ftm-border);
    color: var(--ftm-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
}
.ftm-support-link:hover {
    background: rgba(0,212,170,0.06);
    border-color: rgba(0,212,170,0.2);
    color: #00d4aa;
}
.ftm-support-link svg {
    color: var(--ftm-accent);
    flex-shrink: 0;
}

/* ---- Summary Cards Grid ---- */
.ftm-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(160px, 12vw, 220px), 1fr));
    gap: 14px;
    margin-bottom: 24px;
    width: 100%;
}

.ftm-summary-card {
    --_accent: var(--ftm-accent);
    --_rgb: 59, 130, 246;
    background: linear-gradient(145deg, rgba(20, 27, 45, 0.85), rgba(14, 20, 36, 0.65));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--ftm-radius);
    padding: 20px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Accent stripe */
.ftm-summary-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    opacity: 0.55;
    transition: opacity 0.4s ease, height 0.3s ease;
}

/* Ambient glow from top */
.ftm-summary-card::after {
    content: '';
    position: absolute;
    top: -40px; left: -20%; right: -20%;
    height: 120px;
    background: radial-gradient(ellipse at 50% 0%, rgba(var(--_rgb), 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ftm-summary-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--_rgb), 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(var(--_rgb), 0.06),
                0 4px 20px rgba(var(--_rgb), 0.08);
}

.ftm-summary-card:hover::before { opacity: 1; height: 3px; }
.ftm-summary-card:hover::after  { opacity: 1; }

/* Per-card accents */
.ftm-card-open      { --_accent: var(--ftm-cyan);   --_rgb: 6, 182, 212; }
.ftm-card-profit    { --_accent: var(--ftm-green);  --_rgb: 16, 185, 129; }
.ftm-card-trades    { --_accent: var(--ftm-accent); --_rgb: 59, 130, 246; }
.ftm-card-winrate   { --_accent: var(--ftm-yellow); --_rgb: 245, 158, 11; }
.ftm-card-drawdown  { --_accent: var(--ftm-red);    --_rgb: 239, 68, 68; }
.ftm-card-avg       { --_accent: var(--ftm-purple); --_rgb: 139, 92, 246; }

/* Gradient top-lines */
.ftm-card-open::before     { background: linear-gradient(90deg, var(--ftm-cyan), var(--ftm-accent)); }
.ftm-card-profit::before   { background: linear-gradient(90deg, var(--ftm-green), var(--ftm-cyan)); }
.ftm-card-trades::before   { background: linear-gradient(90deg, var(--ftm-accent), var(--ftm-purple)); }
.ftm-card-winrate::before  { background: linear-gradient(90deg, var(--ftm-yellow), #fb923c); }
.ftm-card-drawdown::before { background: linear-gradient(90deg, var(--ftm-red), var(--ftm-pink)); }
.ftm-card-avg::before      { background: linear-gradient(90deg, var(--ftm-purple), var(--ftm-pink)); }

/* Featured card (Open Trades) */
.ftm-card-featured {
    border-color: rgba(6, 182, 212, 0.12);
    background: linear-gradient(145deg, rgba(6, 182, 212, 0.06), rgba(20, 27, 45, 0.85));
}
.ftm-card-featured::before { height: 3px; opacity: 0.85; }
.ftm-card-featured::after  { opacity: 0.6; }

.ftm-card-featured .ftm-card-label::after {
    content: 'LIVE';
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    margin-left: 2px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--ftm-cyan);
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.18);
    border-radius: 4px;
    line-height: 1.4;
    animation: ftmLiveBadge 2.5s ease-in-out infinite;
}

@keyframes ftmLiveBadge {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(6, 182, 212, 0.15); }
    50% { opacity: 0.55; box-shadow: none; }
}

/* Icon */
.ftm-card-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(var(--_rgb), 0.08);
    border: 1px solid rgba(var(--_rgb), 0.1);
    flex-shrink: 0;
    transition: all 0.35s ease;
    position: relative;
    z-index: 1;
}

.ftm-summary-card:hover .ftm-card-icon {
    background: rgba(var(--_rgb), 0.14);
    border-color: rgba(var(--_rgb), 0.2);
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(var(--_rgb), 0.12);
}

.ftm-card-icon svg {
    width: 20px;
    height: 20px;
    color: var(--_accent);
    transition: all 0.3s ease;
}

/* Card content */
.ftm-card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    position: relative;
    z-index: 1;
}

.ftm-card-label {
    font-size: 11px;
    color: var(--ftm-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.ftm-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ftm-text);
    font-family: var(--ftm-mono);
    line-height: 1.2;
    letter-spacing: -0.5px;
    transition: color 0.4s ease;
}

.ftm-card-sub {
    font-size: 12px;
    color: var(--ftm-text-secondary);
    margin-top: 3px;
    font-family: var(--ftm-mono);
    font-weight: 500;
    transition: color 0.4s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ftm-card-sub.positive { color: var(--ftm-green) !important; }
.ftm-card-sub.negative { color: var(--ftm-red) !important; }

/* Open Trades card layout */
.ftm-open-upnl-value {
    font-size: 26px !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.ftm-open-upnl-label {
    font-size: 10px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ftm-text-muted) !important;
    margin-top: 1px !important;
}

.ftm-open-count-small {
    font-size: 11px !important;
    color: var(--ftm-text-secondary) !important;
    margin-top: 6px !important;
    font-weight: 400;
}

/* Invested info line */
.ftm-invested-info {
    font-size: 11px !important;
    color: var(--ftm-text-secondary) !important;
    margin-top: 2px !important;
    font-family: var(--ftm-mono);
    font-weight: 400;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â–ˆâ–ˆ  CHARTS â€“ Premium Redesign
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* ---- Charts Grid ---- */
.ftm-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

/* â”€â”€ Chart Card Shell â”€â”€ */
.ftm-chart-container {
    background: var(--ftm-bg-card);
    border: 1px solid var(--ftm-border);
    border-radius: var(--ftm-radius);
    padding: 0;
    overflow: hidden;
    position: relative;
    transition: transform .3s cubic-bezier(.22,1,.36,1),
                box-shadow .3s cubic-bezier(.22,1,.36,1),
                border-color .3s ease;
}

.ftm-chart-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--ftm-radius);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 50%, rgba(59,130,246,.06) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.ftm-chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.05);
}

/* Card-specific hover glows */
.ftm-cc-profit:hover   { border-color: rgba(0,229,176,.25); box-shadow: 0 8px 32px rgba(0,229,176,.06); }
.ftm-cc-daily:hover    { border-color: rgba(79,141,247,.25); box-shadow: 0 8px 32px rgba(79,141,247,.06); }
.ftm-cc-winloss:hover  { border-color: rgba(34,211,238,.25); box-shadow: 0 8px 32px rgba(34,211,238,.06); }
.ftm-cc-pair:hover     { border-color: rgba(255,183,68,.25); box-shadow: 0 8px 32px rgba(255,183,68,.06); }
.ftm-cc-duration:hover { border-color: rgba(155,109,255,.25); box-shadow: 0 8px 32px rgba(155,109,255,.06); }

.ftm-chart-container canvas {
    display: block !important;
    border-radius: 0 0 8px 8px;
}

.ftm-chart-large {
    grid-column: 1 / -1;
}

/* â”€â”€ Chart Header (Premium) â”€â”€ */
.ftm-cc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.ftm-cc-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ftm-cc-title-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ftm-cc-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ftm-text);
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ftm-cc-subtitle {
    font-size: 11px;
    color: var(--ftm-text-muted);
    font-weight: 500;
    letter-spacing: .01em;
}

/* â”€â”€ Chart Icon Wraps (themed) â”€â”€ */
.ftm-cc-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    transition: transform .3s ease, box-shadow .3s ease;
}

.ftm-chart-container:hover .ftm-cc-icon-wrap {
    transform: scale(1.08);
}

.ftm-cc-icon-green {
    background: linear-gradient(135deg, rgba(0,229,176,.18), rgba(6,182,212,.08));
    border: 1px solid rgba(0,229,176,.25);
    color: #00e5b0;
    box-shadow: 0 2px 8px rgba(0,229,176,.12);
}

.ftm-cc-icon-blue {
    background: linear-gradient(135deg, rgba(79,141,247,.18), rgba(99,102,241,.08));
    border: 1px solid rgba(79,141,247,.25);
    color: #4f8df7;
    box-shadow: 0 2px 8px rgba(79,141,247,.12);
}

.ftm-cc-icon-cyan {
    background: linear-gradient(135deg, rgba(34,211,238,.18), rgba(6,182,212,.08));
    border: 1px solid rgba(34,211,238,.25);
    color: #22d3ee;
    box-shadow: 0 2px 8px rgba(34,211,238,.12);
}

.ftm-cc-icon-yellow {
    background: linear-gradient(135deg, rgba(255,183,68,.18), rgba(245,158,11,.08));
    border: 1px solid rgba(255,183,68,.25);
    color: #ffb744;
    box-shadow: 0 2px 8px rgba(255,183,68,.12);
}

.ftm-cc-icon-purple {
    background: linear-gradient(135deg, rgba(155,109,255,.18), rgba(168,85,247,.08));
    border: 1px solid rgba(155,109,255,.25);
    color: #9b6dff;
    box-shadow: 0 2px 8px rgba(155,109,255,.12);
}

/* â”€â”€ Accent Lines (animated gradient per chart) â”€â”€ */
.ftm-cc-accent-line {
    height: 2px;
    margin: 0 20px;
    border-radius: 1px;
    background-size: 200% 100%;
    opacity: .5;
    animation: ftmCcAccentShift 4s linear infinite;
}

.ftm-cc-accent-green  { background: linear-gradient(90deg, #00e5b0, #22d3ee, #00e5b0, transparent); }
.ftm-cc-accent-blue   { background: linear-gradient(90deg, #4f8df7, #6366f1, #4f8df7, transparent); }
.ftm-cc-accent-cyan   { background: linear-gradient(90deg, #22d3ee, #2dd4bf, #22d3ee, transparent); }
.ftm-cc-accent-yellow { background: linear-gradient(90deg, #ffb744, #ff9f43, #ffb744, transparent); }
.ftm-cc-accent-purple { background: linear-gradient(90deg, #9b6dff, #d946ef, #9b6dff, transparent); }

@keyframes ftmCcAccentShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* â”€â”€ Chart Controls (Filter Buttons) â”€â”€ */
.ftm-chart-controls {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ftm-chart-btn {
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: var(--ftm-text-muted);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s cubic-bezier(.22,1,.36,1);
    font-family: var(--ftm-font);
    white-space: nowrap;
    line-height: 1.4;
    letter-spacing: .02em;
}

.ftm-chart-btn:hover {
    background: rgba(59,130,246,.12);
    border-color: rgba(59,130,246,.3);
    color: var(--ftm-text);
    transform: translateY(-1px);
}

.ftm-chart-btn.active {
    background: linear-gradient(135deg, var(--ftm-accent), #6366f1);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 10px rgba(59,130,246,.3);
    transform: translateY(-1px);
}

/* Per-chart active button themes */
.ftm-cc-profit .ftm-chart-btn.active {
    background: linear-gradient(135deg, #00e5b0, #22d3ee);
    box-shadow: 0 2px 10px rgba(0,229,176,.3);
}

.ftm-cc-daily .ftm-chart-btn.active {
    background: linear-gradient(135deg, #4f8df7, #6366f1);
    box-shadow: 0 2px 10px rgba(79,141,247,.3);
}

.ftm-cc-duration .ftm-chart-btn.active {
    background: linear-gradient(135deg, #9b6dff, #d946ef);
    box-shadow: 0 2px 10px rgba(155,109,255,.3);
}

/* ---- Chart Scroll Wrapper ---- */
.ftm-chart-scroll-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 8px 16px 16px;
    min-width: 0;
    min-height: 200px;
    position: relative;
}

/* Scrollbar styling */
.ftm-chart-scroll-wrap::-webkit-scrollbar {
    height: 6px;
}

.ftm-chart-scroll-wrap::-webkit-scrollbar-track {
    background: rgba(255,255,255,.02);
    border-radius: 3px;
}

.ftm-chart-scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.08);
    border-radius: 3px;
    transition: background .2s ease;
}

.ftm-chart-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.15);
}

/* Canvas inside chart containers */
.ftm-chart-scroll-wrap canvas,
.ftm-chart-container canvas {
    display: block !important;
    width: 100% !important;
    min-width: 280px;
    max-width: 100%;
}

/* No-scroll charts get direct padding */
.ftm-cc-winloss > canvas {
    padding: 8px 16px 16px;
}

/* Ctrl+Scroll hint overlay */
.ftm-chart-scroll-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(6,10,24,0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 10px 22px;
    border-radius: 10px;
    color: rgba(255,255,255,0.88);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--ftm-font);
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s ease;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    letter-spacing: .01em;
}
.ftm-chart-scroll-hint.visible {
    opacity: 1;
}

/* ---- Info Cards Grid ---- */
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â–ˆâ–ˆ  INFO CARDS â€“ Premium Redesign (Strategy / Exchange / Performance)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.ftm-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

/* â”€â”€ Card Shell â”€â”€ */
.ftm-info-card {
    background: var(--ftm-bg-card);
    border: 1px solid var(--ftm-border);
    border-radius: var(--ftm-radius);
    padding: 0;
    overflow: hidden;
    position: relative;
    transition: transform .3s cubic-bezier(.22,1,.36,1),
                box-shadow .3s cubic-bezier(.22,1,.36,1),
                border-color .3s ease;
}

.ftm-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.05);
}

/* Card-specific hover glow */
.ftm-ic-strategy:hover  { border-color: rgba(59,130,246,.3); box-shadow: 0 8px 32px rgba(59,130,246,.08); }
.ftm-ic-exchange:hover   { border-color: rgba(16,185,129,.3); box-shadow: 0 8px 32px rgba(16,185,129,.08); }
.ftm-ic-performance:hover { border-color: rgba(139,92,246,.3); box-shadow: 0 8px 32px rgba(139,92,246,.08); }

/* â”€â”€ Card Header â”€â”€ */
.ftm-ic-header {
    padding: 16px 20px 12px;
}

.ftm-ic-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ftm-ic-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ftm-text);
    letter-spacing: -.2px;
}

/* â”€â”€ Icon Wrap (themed) â”€â”€ */
.ftm-ic-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    transition: transform .3s ease, box-shadow .3s ease;
}

.ftm-info-card:hover .ftm-ic-icon-wrap {
    transform: scale(1.08);
}

.ftm-ic-icon-blue {
    background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(6,182,212,.1));
    border: 1px solid rgba(59,130,246,.25);
    color: var(--ftm-accent);
    box-shadow: 0 2px 8px rgba(59,130,246,.12);
}

.ftm-ic-icon-green {
    background: linear-gradient(135deg, rgba(16,185,129,.18), rgba(6,182,212,.1));
    border: 1px solid rgba(16,185,129,.25);
    color: var(--ftm-green);
    box-shadow: 0 2px 8px rgba(16,185,129,.12);
}

.ftm-ic-icon-purple {
    background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(168,85,247,.1));
    border: 1px solid rgba(139,92,246,.25);
    color: var(--ftm-purple);
    box-shadow: 0 2px 8px rgba(139,92,246,.12);
}

/* â”€â”€ Accent Line (animated gradient) â”€â”€ */
.ftm-ic-accent-line {
    height: 2px;
    margin: 0 20px;
    border-radius: 1px;
    background-size: 200% 100%;
    opacity: .55;
    animation: ftmIcAccentShift 4s linear infinite;
}

.ftm-ic-accent-blue   { background: linear-gradient(90deg, var(--ftm-accent), var(--ftm-cyan), var(--ftm-accent), transparent); }
.ftm-ic-accent-green  { background: linear-gradient(90deg, var(--ftm-green), var(--ftm-cyan), var(--ftm-green), transparent); }
.ftm-ic-accent-purple { background: linear-gradient(90deg, var(--ftm-purple), #c084fc, var(--ftm-purple), transparent); }

@keyframes ftmIcAccentShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* â”€â”€ Rows Container â”€â”€ */
.ftm-info-grid-inner {
    padding: 4px 20px 16px;
}

/* â”€â”€ Individual Row â”€â”€ */
.ftm-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px;
    margin: 0 -10px;
    border-radius: 8px;
    border-bottom: none;
    transition: background .2s ease, transform .2s ease;
    position: relative;
}

.ftm-info-row:hover {
    background: rgba(255,255,255,.03);
}

/* Subtle separator between rows */
.ftm-info-row + .ftm-info-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
}

/* â”€â”€ Row Icons â”€â”€ */
.ftm-ir-icon {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    vertical-align: -2px;
    opacity: .4;
    transition: opacity .2s ease, color .2s ease;
    flex-shrink: 0;
}

.ftm-info-row:hover .ftm-ir-icon {
    opacity: .7;
}

/* Card-specific icon hover colors */
.ftm-ic-strategy .ftm-info-row:hover .ftm-ir-icon  { color: var(--ftm-accent); }
.ftm-ic-exchange .ftm-info-row:hover .ftm-ir-icon   { color: var(--ftm-green); }
.ftm-ic-performance .ftm-info-row:hover .ftm-ir-icon { color: var(--ftm-purple); }

/* â”€â”€ Labels â”€â”€ */
.ftm-info-label {
    font-size: 13px;
    color: var(--ftm-text-muted);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* â”€â”€ Values â”€â”€ */
.ftm-info-value {
    font-size: 13px;
    color: var(--ftm-text);
    font-weight: 600;
    font-family: var(--ftm-mono);
    text-align: right;
    transition: color .3s ease;
}

/* Highlight value (strategy name, exchange name) */
.ftm-iv-highlight {
    color: var(--ftm-text);
    font-weight: 700;
    font-size: 13px;
}

/* Invested value â€“ special emphasis */
.ftm-iv-invested {
    color: var(--ftm-green);
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 0 12px rgba(16,185,129,.2);
}

/* â”€â”€ Badge Values â”€â”€ */
.ftm-iv-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--ftm-mono);
    line-height: 1.5;
}

.ftm-iv-badge-blue {
    background: rgba(59,130,246,.1);
    border: 1px solid rgba(59,130,246,.2);
    color: var(--ftm-accent);
}

.ftm-iv-badge-green {
    background: rgba(16,185,129,.1);
    border: 1px solid rgba(16,185,129,.2);
    color: var(--ftm-green);
}

.ftm-iv-badge-red {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.2);
    color: var(--ftm-red);
}

.ftm-iv-badge-cyan {
    background: rgba(6,182,212,.1);
    border: 1px solid rgba(6,182,212,.2);
    color: var(--ftm-cyan);
}

.ftm-iv-badge-purple {
    background: rgba(139,92,246,.1);
    border: 1px solid rgba(139,92,246,.2);
    color: var(--ftm-purple);
}

.ftm-iv-badge-yellow {
    background: rgba(245,158,11,.1);
    border: 1px solid rgba(245,158,11,.2);
    color: var(--ftm-yellow);
}

/* Dynamic color classes applied by JS */
.ftm-iv-positive { color: var(--ftm-green) !important; }
.ftm-iv-negative { color: var(--ftm-red) !important; }
.ftm-iv-neutral  { color: var(--ftm-text-secondary) !important; }

/* Dry Run special badges */
.ftm-iv-live {
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.25);
    color: var(--ftm-green);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.ftm-iv-paper {
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.25);
    color: var(--ftm-yellow);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

/* â”€â”€ Row Stagger Animation â”€â”€ */
@keyframes ftmRowSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ftm-info-row {
    animation: ftmRowSlideIn .35s ease forwards;
    opacity: 0;
}

.ftm-info-row:nth-child(1) { animation-delay: .08s; }
.ftm-info-row:nth-child(2) { animation-delay: .12s; }
.ftm-info-row:nth-child(3) { animation-delay: .16s; }
.ftm-info-row:nth-child(4) { animation-delay: .20s; }
.ftm-info-row:nth-child(5) { animation-delay: .24s; }
.ftm-info-row:nth-child(6) { animation-delay: .28s; }
.ftm-info-row:nth-child(7) { animation-delay: .32s; }
.ftm-info-row:nth-child(8) { animation-delay: .36s; }

/* Perf Stats â€“ color-coded values via JS data attributes */
.ftm-ic-performance .ftm-info-value[data-rating="good"] {
    color: var(--ftm-green);
    text-shadow: 0 0 10px rgba(16,185,129,.15);
}

.ftm-ic-performance .ftm-info-value[data-rating="warn"] {
    color: var(--ftm-yellow);
}

.ftm-ic-performance .ftm-info-value[data-rating="bad"] {
    color: var(--ftm-red);
    text-shadow: 0 0 10px rgba(239,68,68,.15);
}

/* ---- Sections ---- */
.ftm-section {
    margin-bottom: 24px;
}

.ftm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.ftm-section-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ftm-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ftm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ftm-dot-green {
    background: var(--ftm-green);
    box-shadow: 0 0 6px var(--ftm-green-glow);
}

.ftm-dot-gray {
    background: var(--ftm-text-muted);
}

.ftm-badge {
    background: var(--ftm-glass);
    border: 1px solid var(--ftm-border);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ftm-text-secondary);
}

.ftm-table-controls {
    display: flex;
    gap: 8px;
}

.ftm-search-input {
    padding: 6px 14px;
    background: var(--ftm-bg-card);
    border: 1px solid var(--ftm-border);
    border-radius: var(--ftm-radius-xs);
    color: var(--ftm-text);
    font-size: 13px;
    font-family: var(--ftm-font);
    outline: none;
    transition: border-color var(--ftm-transition);
    width: 200px;
}

.ftm-search-input:focus {
    border-color: var(--ftm-accent);
}

.ftm-search-input::placeholder {
    color: var(--ftm-text-muted);
}

.ftm-select {
    padding: 6px 14px;
    background: var(--ftm-bg-card);
    border: 1px solid var(--ftm-border);
    border-radius: var(--ftm-radius-xs);
    color: var(--ftm-text);
    font-size: 13px;
    font-family: var(--ftm-font);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* ---- Data Tables ---- */
.ftm-table-wrap {
    position: relative;
    background: var(--ftm-bg-card);
    border: 1px solid var(--ftm-border);
    border-radius: var(--ftm-radius);
    overflow: hidden;
    width: 100%;
}

.ftm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: clamp(12px, 0.85vw, 14px);
    table-layout: auto;
}

.ftm-table thead th {
    background: var(--ftm-bg-elevated);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ftm-text-muted);
    border-bottom: 1px solid var(--ftm-border);
    white-space: nowrap;
    cursor: default;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 2;
}

.ftm-table thead th[data-sort] {
    cursor: pointer;
}

.ftm-table thead th[data-sort]:hover {
    color: var(--ftm-text);
}

.ftm-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    color: var(--ftm-text-secondary);
    font-family: var(--ftm-mono);
    font-size: 12px;
    white-space: nowrap;
}

.ftm-table tbody tr {
    transition: background var(--ftm-transition);
}

.ftm-table tbody tr:hover {
    background: rgba(59, 130, 246, .04);
}

.ftm-table tbody tr:last-child td {
    border-bottom: none;
}

.ftm-table .ftm-pair {
    font-weight: 600;
    color: var(--ftm-text);
}

.ftm-table .ftm-positive {
    color: var(--ftm-green);
    font-weight: 600;
}

.ftm-table .ftm-negative {
    color: var(--ftm-red);
    font-weight: 600;
}

.ftm-table .ftm-side-long {
    color: var(--ftm-green);
    font-weight: 600;
}

.ftm-table .ftm-side-short {
    color: var(--ftm-red);
    font-weight: 600;
}

.ftm-table .ftm-empty {
    text-align: center;
    padding: 32px;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-font);
    font-style: italic;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â–ˆâ–ˆ  PREMIUM OPEN TRADES TABLE  â–ˆâ–ˆ
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Section Container â”€â”€ */
.ftm-ot-section {
    position: relative;
}

/* â”€â”€ Header Row â”€â”€ */
.ftm-ot-header {
    margin-bottom: 16px;
}

.ftm-ot-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ftm-ot-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ftm-ot-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(6,182,212,.1));
    border: 1px solid rgba(59,130,246,.2);
    color: var(--ftm-accent);
    flex-shrink: 0;
    animation: ftmIconFloat 3s ease-in-out infinite;
}

@keyframes ftmIconFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}

.ftm-ot-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ftm-text);
    letter-spacing: -.3px;
}

.ftm-ot-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ftm-accent), var(--ftm-cyan));
    color: #fff;
    font-family: var(--ftm-mono);
    box-shadow: 0 2px 8px rgba(59,130,246,.3);
    animation: ftmCountPop .4s cubic-bezier(.22,1,.36,1);
}

@keyframes ftmCountPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* â”€â”€ Total P/L Summary Chip â”€â”€ */
.ftm-ot-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ftm-ot-summary-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--ftm-border);
    font-family: var(--ftm-font);
    transition: all .3s ease;
}

.ftm-ot-summary-chip.ftm-chip-positive {
    background: rgba(16,185,129,.08);
    border-color: rgba(16,185,129,.25);
}

.ftm-ot-summary-chip.ftm-chip-negative {
    background: rgba(239,68,68,.08);
    border-color: rgba(239,68,68,.25);
}

.ftm-ot-chip-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--ftm-text-muted);
}

.ftm-ot-chip-value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--ftm-mono);
    color: var(--ftm-text);
    transition: color .3s;
}

.ftm-chip-positive .ftm-ot-chip-value { color: #10b981; }
.ftm-chip-negative .ftm-ot-chip-value { color: #ef4444; }

/* â”€â”€ Accent Line â”€â”€ */
.ftm-ot-accent-line {
    height: 2px;
    margin-top: 12px;
    border-radius: 1px;
    background: linear-gradient(90deg, var(--ftm-accent), var(--ftm-cyan), var(--ftm-purple), transparent);
    background-size: 200% 100%;
    animation: ftmAccentShift 4s linear infinite;
    opacity: .6;
}

@keyframes ftmAccentShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* â”€â”€ Table Wrapper Override â”€â”€ */
.ftm-ot-table-wrap {
    border-radius: var(--ftm-radius);
    border: 1px solid rgba(255,255,255,.06);
    background: linear-gradient(180deg, var(--ftm-bg-card) 0%, rgba(20,27,45,.95) 100%);
    box-shadow: 0 4px 30px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.04);
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
}

/* Subtle top shine */
.ftm-ot-table-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(59,130,246,.3) 30%, rgba(6,182,212,.3) 70%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}

/* â”€â”€ Premium Table Head â”€â”€ */
.ftm-ot-table thead th {
    background: linear-gradient(180deg, rgba(30,39,66,.95) 0%, rgba(20,27,45,.95) 100%);
    padding: 14px 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    color: rgba(148,163,184,.8);
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-transform: uppercase;
    position: relative;
}

.ftm-ot-table thead th::after {
    content: '';
    position: absolute;
    right: 0; top: 25%; bottom: 25%;
    width: 1px;
    background: rgba(255,255,255,.04);
}

.ftm-ot-table thead th:last-child::after { display: none; }

/* Column-specific widths & alignment
   Prefixed with .ftm-ot-table for specificity (0-2-0)
   to override .ftm-table thead th text-align:left (0-1-2) */
.ftm-ot-table .ftm-th-num     { width: 40px; text-align: center; }
.ftm-ot-table .ftm-th-pair    { min-width: 130px; text-align: left; }
.ftm-ot-table .ftm-th-side    { width: 80px; text-align: center; }
.ftm-ot-table .ftm-th-stake   { text-align: right; }
.ftm-ot-table .ftm-th-entry   { text-align: right; }
.ftm-ot-table .ftm-th-current { text-align: right; }
.ftm-ot-table .ftm-th-pnlpct  { text-align: center; }
.ftm-ot-table .ftm-th-pnl    { text-align: right; }
.ftm-ot-table .ftm-th-duration { text-align: center; }
.ftm-ot-table .ftm-th-sl      { text-align: right; }
.ftm-ot-table .ftm-th-opened  { text-align: right; }

/* â”€â”€ Premium Table Rows â”€â”€ */
.ftm-ot-table tbody .ftm-ot-row {
    transition: background .25s ease, box-shadow .25s ease, transform .15s ease;
    position: relative;
}

.ftm-ot-table tbody .ftm-ot-row:hover {
    background: rgba(59,130,246,.05);
    box-shadow: inset 0 0 40px rgba(59,130,246,.03);
}

.ftm-ot-table tbody .ftm-ot-row td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    font-size: 13px;
    vertical-align: middle;
    transition: color .3s ease;
    /* Guarantee visibility — prevent data cells from disappearing */
    opacity: 1 !important;
    visibility: visible !important;
}

.ftm-ot-table tbody .ftm-ot-row:last-child td {
    border-bottom: none;
}

/* Row entrance animation */
.ftm-row-enter {
    animation: ftmOtRowSlideIn .4s cubic-bezier(.22,1,.36,1) both;
}

@keyframes ftmOtRowSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-12px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .ftm-row-enter {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .ftm-price-roller,
    .ftm-price-roller * {
        animation: none !important;
        transition: none !important;
    }
    .ftm-ot-row,
    .ftm-ot-row td {
        transition: none !important;
    }
    .ftm-status-bar,
    .ftm-status-hero,
    .ftm-status-live-badge,
    .ftm-status-info,
    .ftm-status-tabs,
    .ftm-pulse-core,
    .ftm-pulse-ring::before,
    .ftm-pulse-ring::after,
    .ftm-uptime-badge svg,
    .ftm-status-text.ftm-status-reveal {
        animation: none !important;
    }
}

/* â”€â”€ Cell: Row Number â”€â”€ */
.ftm-td-num {
    text-align: center;
}

.ftm-row-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    font-size: 11px;
    font-weight: 600;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-mono);
}

.ftm-ot-row:hover .ftm-row-num {
    background: rgba(59,130,246,.12);
    border-color: rgba(59,130,246,.2);
    color: var(--ftm-accent);
}

/* â”€â”€ Cell: Pair â”€â”€ */
.ftm-ot-table .ftm-pair-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ftm-ot-table .ftm-pair-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(139,92,246,.1));
    border: 1px solid rgba(59,130,246,.15);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ftm-accent);
    flex-shrink: 0;
    transition: transform .2s, box-shadow .2s;
}

.ftm-ot-row:hover .ftm-pair-icon {
    transform: scale(1.08);
    box-shadow: 0 2px 10px rgba(59,130,246,.2);
}

.ftm-pair-name {
    font-weight: 600;
    color: var(--ftm-text);
    font-size: 13px;
    letter-spacing: .2px;
}

/* â”€â”€ Cell: Side (Long/Short Pill) â”€â”€ */
.ftm-td-side {
    text-align: center;
}

.ftm-side-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: var(--ftm-font);
}

.ftm-side-pill.ftm-side-long {
    background: rgba(16,185,129,.1);
    color: #10b981;
    border: 1px solid rgba(16,185,129,.2);
}

.ftm-side-pill.ftm-side-short {
    background: rgba(239,68,68,.1);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,.2);
}

/* â”€â”€ Cell: Stake + Leverage â”€â”€ */
.ftm-td-stake {
    text-align: right;
    color: var(--ftm-text);
}

.ftm-stake-val {
    color: inherit;
    font-weight: 500;
}

.ftm-leverage-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: rgba(245,158,11,.12);
    color: var(--ftm-yellow);
    border: 1px solid rgba(245,158,11,.2);
    vertical-align: middle;
    font-family: var(--ftm-mono);
}

/* â”€â”€ Cell: Entry Price â”€â”€ */
.ftm-td-entry {
    text-align: right;
    color: var(--ftm-text-secondary);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

/* â”€â”€ Cell: Duration â”€â”€ */
.ftm-td-duration {
    text-align: center;
}

.ftm-dur-val {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(6,182,212,.06);
    border: 1px solid rgba(6,182,212,.12);
    color: var(--ftm-cyan);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--ftm-mono);
}

/* â”€â”€ Cell: Stop Loss â”€â”€ */
.ftm-td-sl {
    text-align: right;
}

.ftm-sl-price {
    color: var(--ftm-text-secondary);
}

.ftm-sl-dist {
    display: inline-block;
    margin-left: 5px;
    font-size: 10px;
    color: var(--ftm-text-muted);
    opacity: .7;
}

/* â”€â”€ Cell: Opened Date â”€â”€ */
.ftm-td-opened {
    text-align: right;
    color: var(--ftm-text-muted);
    font-size: 11px !important;
}

/* â”€â”€ P/L % Chip (Colored Badge) â”€â”€ */
.ftm-pnl-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    font-family: var(--ftm-mono);
    transition: background .3s, color .3s, box-shadow .3s;
    min-width: 60px;
    text-align: center;
}

.ftm-pnl-chip.ftm-profit-positive {
    background: rgba(16,185,129,.12);
    color: #10b981 !important;
    border: 1px solid rgba(16,185,129,.2);
    box-shadow: 0 0 12px rgba(16,185,129,.08);
}

.ftm-pnl-chip.ftm-profit-negative {
    background: rgba(239,68,68,.12);
    color: #ef4444 !important;
    border: 1px solid rgba(239,68,68,.2);
    box-shadow: 0 0 12px rgba(239,68,68,.08);
}

/* â”€â”€ Empty State â”€â”€ */
.ftm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-font);
}

.ftm-empty-state svg {
    opacity: .3;
    color: var(--ftm-accent);
}

.ftm-empty-state span {
    font-size: 14px;
    font-weight: 500;
}

/* â”€â”€ Profit row left-edge indicator â”€â”€ */
.ftm-ot-row.ftm-profit-positive {
    border-left: 3px solid rgba(16,185,129,.45);
    color: inherit !important;
}

.ftm-ot-row.ftm-profit-negative {
    border-left: 3px solid rgba(239,68,68,.45);
    color: inherit !important;
}

.ftm-ot-row.ftm-profit-positive:hover {
    border-left-color: rgba(16,185,129,.7);
    background: rgba(16,185,129,.03);
}

.ftm-ot-row.ftm-profit-negative:hover {
    border-left-color: rgba(239,68,68,.7);
    background: rgba(239,68,68,.03);
}

/* Override global profit color on rows â€” only cells should be colored */
.ftm-ot-table tbody .ftm-ot-row.ftm-profit-positive > td { color: var(--ftm-text-secondary); }
.ftm-ot-table tbody .ftm-ot-row.ftm-profit-negative > td { color: var(--ftm-text-secondary); }
.ftm-ot-table tbody .ftm-ot-row > td.ftm-live-pnl-abs { font-weight: 700; text-align: right; }
.ftm-ot-table tbody .ftm-ot-row > td.ftm-live-price { text-align: right; }
.ftm-ot-table tbody .ftm-ot-row > td.ftm-live-pnl-pct { text-align: center; }

/* â”€â”€ Responsive: Open Trades â”€â”€ */
@media (max-width: 768px) {
    /* Mobile table-specific rules for Open Trades */
    .ftm-ot-table tbody .ftm-ot-row td { padding: 10px 12px; font-size: 12px; }
    .ftm-ot-table thead th { padding: 10px 12px; font-size: 9px; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â–ˆâ–ˆ  PREMIUM CLOSED TRADES TABLE  â–ˆâ–ˆ
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Section â”€â”€ */
.ftm-ct-section { position: relative; }

/* â”€â”€ Header â”€â”€ */
.ftm-ct-header { margin-bottom: 16px; }

.ftm-ct-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ftm-ct-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ftm-ct-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139,92,246,.15), rgba(236,72,153,.1));
    border: 1px solid rgba(139,92,246,.2);
    color: var(--ftm-purple);
    flex-shrink: 0;
}

.ftm-ct-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ftm-text);
    letter-spacing: -.3px;
}

.ftm-ct-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ftm-purple), var(--ftm-pink));
    color: #fff;
    font-family: var(--ftm-mono);
    box-shadow: 0 2px 8px rgba(139,92,246,.3);
}

/* â”€â”€ Controls (Search + Filter) â”€â”€ */
.ftm-ct-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ftm-ct-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ftm-ct-search-icon {
    position: absolute;
    left: 10px;
    color: var(--ftm-text-muted);
    pointer-events: none;
}

.ftm-ct-search-input {
    padding: 7px 12px 7px 30px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--ftm-border);
    border-radius: 8px;
    color: var(--ftm-text);
    font-size: 12px;
    font-family: var(--ftm-font);
    width: 180px;
    transition: all .25s ease;
    outline: none;
}

.ftm-ct-search-input:focus {
    border-color: rgba(139,92,246,.4);
    background: rgba(139,92,246,.05);
    box-shadow: 0 0 0 3px rgba(139,92,246,.08);
    width: 220px;
}

.ftm-ct-search-input::placeholder {
    color: var(--ftm-text-muted);
}

.ftm-ct-filter-wrap {
    position: relative;
}

.ftm-ct-filter-select {
    padding: 7px 28px 7px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--ftm-border);
    border-radius: 8px;
    color: var(--ftm-text);
    font-size: 12px;
    font-family: var(--ftm-font);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all .25s ease;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.ftm-ct-filter-select:focus {
    border-color: rgba(139,92,246,.4);
    box-shadow: 0 0 0 3px rgba(139,92,246,.08);
}

/* â”€â”€ Stats Strip â”€â”€ */
.ftm-ct-stats-strip {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 14px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(30,39,66,.8), rgba(20,27,45,.9));
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 10px;
    flex-wrap: wrap;
}

.ftm-ct-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 20px;
    flex: 1;
    min-width: 80px;
}

.ftm-ct-stat-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-font);
}

.ftm-ct-stat-value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--ftm-mono);
    color: var(--ftm-text);
    transition: color .3s;
}

.ftm-ct-stat-value.ftm-ct-val-positive { color: #10b981; }
.ftm-ct-stat-value.ftm-ct-val-negative { color: #ef4444; }
.ftm-ct-stat-value.ftm-ct-best { color: #10b981; }
.ftm-ct-stat-value.ftm-ct-worst { color: #ef4444; }

.ftm-ct-stat-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,.06);
    flex-shrink: 0;
}

/* â”€â”€ Accent Line â”€â”€ */
.ftm-ct-accent-line {
    height: 2px;
    margin-top: 14px;
    border-radius: 1px;
    background: linear-gradient(90deg, var(--ftm-purple), var(--ftm-pink), var(--ftm-cyan), transparent);
    background-size: 200% 100%;
    animation: ftmCtAccentShift 5s linear infinite;
    opacity: .5;
}

@keyframes ftmCtAccentShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* â”€â”€ Table Wrapper â”€â”€ */
.ftm-ct-table-wrap {
    border-radius: var(--ftm-radius);
    border: 1px solid rgba(255,255,255,.06);
    background: linear-gradient(180deg, var(--ftm-bg-card) 0%, rgba(20,27,45,.95) 100%);
    box-shadow: 0 4px 30px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.04);
    position: relative;
    overflow: hidden;
}

.ftm-ct-table-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,.3), rgba(236,72,153,.2), transparent);
    z-index: 3;
}

/* â”€â”€ Table Head â”€â”€ */
.ftm-ct-table thead th {
    background: linear-gradient(180deg, rgba(30,39,66,.95), rgba(20,27,45,.95));
    padding: 14px 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    color: rgba(148,163,184,.8);
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-transform: uppercase;
    position: relative;
    transition: color .2s;
}

.ftm-ct-table thead th::after {
    content: '';
    position: absolute;
    right: 0; top: 25%; bottom: 25%;
    width: 1px;
    background: rgba(255,255,255,.04);
}

.ftm-ct-table thead th:last-child::after { display: none; }

/* Sort indicators */
.ftm-ct-table thead th[data-sort] { cursor: pointer; }
.ftm-ct-table thead th[data-sort]:hover { color: var(--ftm-text); }

.ftm-ct-table thead th.sort-asc::before,
.ftm-ct-table thead th.sort-desc::before {
    margin-right: 4px;
    font-size: 8px;
    opacity: .8;
}

.ftm-ct-table thead th.sort-asc::before { content: 'â–²'; color: var(--ftm-accent); }
.ftm-ct-table thead th.sort-desc::before { content: 'â–¼'; color: var(--ftm-accent); }

/* Column alignment
   Prefixed with .ftm-ct-table for specificity (0-2-0)
   to override .ftm-table thead th text-align:left (0-1-2) */
.ftm-ct-table .ftm-cth-num       { width: 50px; text-align: center; }
.ftm-ct-table .ftm-cth-pair      { min-width: 120px; text-align: left; }
.ftm-ct-table .ftm-cth-side      { width: 80px; text-align: center; }
.ftm-ct-table .ftm-cth-stake     { text-align: right; }
.ftm-ct-table .ftm-cth-entry     { text-align: right; }
.ftm-ct-table .ftm-cth-exit      { text-align: right; }
.ftm-ct-table .ftm-cth-pnlpct    { text-align: center; min-width: 100px; }
.ftm-ct-table .ftm-cth-pnl       { text-align: right; }
.ftm-ct-table .ftm-cth-duration  { text-align: center; }
.ftm-ct-table .ftm-cth-exit-reason { text-align: center; }
.ftm-ct-table .ftm-cth-opened    { text-align: right; }
.ftm-ct-table .ftm-cth-closed    { text-align: right; }

/* â”€â”€ Table Rows â”€â”€ */
.ftm-ct-table tbody .ftm-ct-row {
    transition: background .25s ease, box-shadow .25s ease;
    position: relative;
}

.ftm-ct-table tbody .ftm-ct-row:hover {
    background: rgba(139,92,246,.04);
}

.ftm-ct-table tbody .ftm-ct-row td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    font-size: 12px;
    vertical-align: middle;
}

.ftm-ct-table tbody .ftm-ct-row:last-child td { border-bottom: none; }

/* Row entrance */
.ftm-ct-row-enter {
    animation: ftmCtRowFadeIn .35s cubic-bezier(.22,1,.36,1) backwards;
}

@keyframes ftmCtRowFadeIn {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Profit/loss left edge */
.ftm-ct-row.ftm-profit-positive {
    box-shadow: inset 3px 0 0 0 rgba(16,185,129,.3);
    color: inherit !important;
}

.ftm-ct-row.ftm-profit-negative {
    box-shadow: inset 3px 0 0 0 rgba(239,68,68,.3);
    color: inherit !important;
}

.ftm-ct-row.ftm-profit-positive:hover {
    box-shadow: inset 3px 0 0 0 rgba(16,185,129,.5), inset 0 0 30px rgba(16,185,129,.02);
}

.ftm-ct-row.ftm-profit-negative:hover {
    box-shadow: inset 3px 0 0 0 rgba(239,68,68,.5), inset 0 0 30px rgba(239,68,68,.02);
}

/* Override profit color on rows */
.ftm-ct-table tbody .ftm-ct-row.ftm-profit-positive > td { color: var(--ftm-text-secondary); }
.ftm-ct-table tbody .ftm-ct-row.ftm-profit-negative > td { color: var(--ftm-text-secondary); }

/* â”€â”€ Cell: Row Number â”€â”€ */
.ftm-ctd-num { text-align: center; }

.ftm-ct-row-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 4px;
    border-radius: 6px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    font-size: 10px;
    font-weight: 600;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-mono);
}

/* â”€â”€ Cell: Pair â”€â”€ */
.ftm-ct-pair-cell {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

/* â”€â”€ Cell: Side â”€â”€ */
.ftm-ctd-side { text-align: center; }

/* â”€â”€ Cell: Stake â”€â”€ */
.ftm-ctd-stake { text-align: right; font-weight: 500; color: var(--ftm-text) !important; }

/* â”€â”€ Cell: Entry/Exit Prices â”€â”€ */
.ftm-ctd-entry, .ftm-ctd-exit {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* â”€â”€ Cell: P/L % with Bar â”€â”€ */
.ftm-ctd-pnlpct { text-align: center; }

.ftm-ct-pnl-bar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
}

.ftm-ct-pnl-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 4px;
    transition: width .3s ease;
}

.ftm-ct-pnl-pct-val {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 11px;
    font-family: var(--ftm-mono);
}

.ftm-ct-pnl-pct-val.ftm-profit-positive { color: #10b981 !important; }
.ftm-ct-pnl-pct-val.ftm-profit-negative { color: #ef4444 !important; }

/* â”€â”€ Cell: P/L $ â”€â”€ */
.ftm-ctd-pnl {
    text-align: right;
    font-weight: 700;
    font-family: var(--ftm-mono);
}

.ftm-ctd-pnl.ftm-profit-positive { color: #10b981 !important; }
.ftm-ctd-pnl.ftm-profit-negative { color: #ef4444 !important; }

/* â”€â”€ Cell: Duration â”€â”€ */
.ftm-ctd-duration { text-align: center; }

/* â”€â”€ Cell: Exit Reason â”€â”€ */
.ftm-ctd-exit-reason { text-align: center; }

/* â”€â”€ Cell: Dates â”€â”€ */
.ftm-ctd-opened, .ftm-ctd-closed {
    text-align: right;
    color: var(--ftm-text-muted) !important;
    font-size: 11px !important;
}

/* â”€â”€ Exit Reason Badges (Enhanced) â”€â”€ */
.ftm-exit-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-family: var(--ftm-font);
    border: 1px solid transparent;
    transition: transform .15s, box-shadow .15s;
}

.ftm-exit-badge:hover {
    transform: scale(1.05);
}

.ftm-exit-roi {
    background: rgba(16,185,129,.1);
    color: #10b981;
    border-color: rgba(16,185,129,.2);
    box-shadow: 0 0 8px rgba(16,185,129,.08);
}

.ftm-exit-stoploss {
    background: rgba(239,68,68,.1);
    color: #ef4444;
    border-color: rgba(239,68,68,.2);
    box-shadow: 0 0 8px rgba(239,68,68,.08);
}

.ftm-exit-trailing {
    background: rgba(245,158,11,.1);
    color: #f59e0b;
    border-color: rgba(245,158,11,.2);
    box-shadow: 0 0 8px rgba(245,158,11,.08);
}

.ftm-exit-signal {
    background: rgba(59,130,246,.1);
    color: #3b82f6;
    border-color: rgba(59,130,246,.2);
    box-shadow: 0 0 8px rgba(59,130,246,.08);
}

.ftm-exit-force {
    background: rgba(236,72,153,.1);
    color: #ec4899;
    border-color: rgba(236,72,153,.2);
    box-shadow: 0 0 8px rgba(236,72,153,.08);
}

.ftm-exit-other {
    background: rgba(148,163,184,.08);
    color: var(--ftm-text-secondary);
    border-color: rgba(148,163,184,.15);
}

/* â”€â”€ Empty State â”€â”€ */
.ftm-ct-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-font);
}

.ftm-ct-empty-state svg { opacity: .25; color: var(--ftm-purple); }
.ftm-ct-empty-state span { font-size: 14px; font-weight: 500; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â–ˆâ–ˆ  PREMIUM PAGINATION  â–ˆâ–ˆ
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.ftm-ct-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.04);
}

.ftm-pg-info-bar {
    width: 100%;
    text-align: center;
}

.ftm-pg-info-text {
    font-size: 12px;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-font);
}

.ftm-pg-info-text strong {
    color: var(--ftm-text-secondary);
    font-weight: 600;
}

.ftm-pg-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ftm-pg-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid var(--ftm-border);
    background: rgba(255,255,255,.03);
    color: var(--ftm-text-secondary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
    font-family: var(--ftm-font);
    line-height: 1;
}

.ftm-pg-btn:hover:not(:disabled) {
    background: rgba(139,92,246,.08);
    border-color: rgba(139,92,246,.3);
    color: var(--ftm-text);
}

.ftm-pg-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.ftm-pg-btn svg {
    flex-shrink: 0;
}

.ftm-pg-numbers {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ftm-pg-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ftm-text-muted);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    font-family: var(--ftm-mono);
}

.ftm-pg-num:hover {
    background: rgba(255,255,255,.05);
    color: var(--ftm-text);
}

.ftm-pg-num.ftm-pg-active {
    background: linear-gradient(135deg, var(--ftm-purple), var(--ftm-accent));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(139,92,246,.3);
    font-weight: 700;
}

.ftm-pg-dots {
    color: var(--ftm-text-muted);
    padding: 0 4px;
    font-size: 14px;
    line-height: 32px;
    user-select: none;
}

/* â”€â”€ Responsive: Closed Trades (handled by main mobile CSS block) â”€â”€ */

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â–ˆâ–ˆ  PREMIUM PAIR PERFORMANCE SUMMARY  â–ˆâ–ˆ
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Section â”€â”€ */
.ftm-pp-section { position: relative; margin-bottom: 24px; }

/* â”€â”€ Header â”€â”€ */
.ftm-pp-header { margin-bottom: 16px; }

.ftm-pp-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ftm-pp-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ftm-pp-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(234,179,8,.1));
    border: 1px solid rgba(245,158,11,.2);
    color: var(--ftm-yellow);
    flex-shrink: 0;
}

.ftm-pp-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ftm-text);
    letter-spacing: -.3px;
}

.ftm-pp-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ftm-yellow), #f97316);
    color: #fff;
    font-family: var(--ftm-mono);
    box-shadow: 0 2px 8px rgba(245,158,11,.3);
}

/* â”€â”€ Controls (Sort Dropdown) â”€â”€ */
.ftm-pp-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ftm-pp-sort-wrap { position: relative; }

.ftm-pp-sort-select {
    padding: 7px 28px 7px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--ftm-border);
    border-radius: 8px;
    color: var(--ftm-text);
    font-size: 12px;
    font-family: var(--ftm-font);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all .25s ease;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.ftm-pp-sort-select:focus {
    border-color: rgba(245,158,11,.4);
    box-shadow: 0 0 0 3px rgba(245,158,11,.08);
}

/* â”€â”€ Stats Strip â”€â”€ */
.ftm-pp-stats-strip {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 14px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(30,39,66,.8), rgba(20,27,45,.9));
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 10px;
    flex-wrap: wrap;
}

.ftm-pp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 20px;
    flex: 1;
    min-width: 80px;
}

.ftm-pp-stat-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-font);
}

.ftm-pp-stat-value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--ftm-mono);
    color: var(--ftm-text);
    transition: color .3s;
}

.ftm-pp-stat-value.ftm-pp-val-positive { color: #10b981; }
.ftm-pp-stat-value.ftm-pp-val-negative { color: #ef4444; }
.ftm-pp-stat-value.ftm-pp-best { color: #10b981; }

.ftm-pp-stat-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,.06);
    flex-shrink: 0;
}

/* â”€â”€ Accent Line â”€â”€ */
.ftm-pp-accent-line {
    height: 2px;
    margin-top: 14px;
    border-radius: 1px;
    background: linear-gradient(90deg, var(--ftm-yellow), #f97316, var(--ftm-cyan), transparent);
    background-size: 200% 100%;
    animation: ftmPpAccentShift 5s linear infinite;
    opacity: .5;
}

@keyframes ftmPpAccentShift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* â”€â”€ Table Wrapper â”€â”€ */
.ftm-pp-table-wrap {
    border-radius: var(--ftm-radius);
    border: 1px solid rgba(255,255,255,.06);
    background: linear-gradient(180deg, var(--ftm-bg-card) 0%, rgba(20,27,45,.95) 100%);
    box-shadow: 0 4px 30px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.04);
    position: relative;
    overflow: hidden;
}

.ftm-pp-table-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245,158,11,.3), rgba(249,115,22,.2), transparent);
    z-index: 3;
}

.ftm-pp-table { width: 100%; border-collapse: collapse; table-layout: auto; }

/* â”€â”€ Table Head â”€â”€ */
.ftm-pp-table thead th {
    background: linear-gradient(180deg, rgba(30,39,66,.95), rgba(20,27,45,.95));
    padding: 14px 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    color: rgba(148,163,184,.8);
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-transform: uppercase;
    position: relative;
    white-space: nowrap;
}

.ftm-pp-table thead th::after {
    content: '';
    position: absolute;
    right: 0; top: 25%; bottom: 25%;
    width: 1px;
    background: rgba(255,255,255,.04);
}

.ftm-pp-table thead th:last-child::after { display: none; }

/* Column widths & alignment
   Prefixed with .ftm-pp-table for specificity (0-2-0)
   to override any base th text-align rules */
.ftm-pp-table .ftm-pth-rank     { width: 50px; text-align: center; }
.ftm-pp-table .ftm-pth-pair     { min-width: 130px; text-align: left; }
.ftm-pp-table .ftm-pth-trades   { width: 80px; text-align: center; }
.ftm-pp-table .ftm-pth-profit   { text-align: right; }
.ftm-pp-table .ftm-pth-avgpct   { text-align: center; min-width: 100px; }
.ftm-pp-table .ftm-pth-wins     { width: 60px; text-align: center; }
.ftm-pp-table .ftm-pth-losses   { width: 70px; text-align: center; }
.ftm-pp-table .ftm-pth-winrate  { text-align: center; min-width: 120px; }

/* â”€â”€ Table Rows â”€â”€ */
.ftm-pp-table tbody .ftm-pp-row {
    transition: background .25s ease, box-shadow .25s ease;
    position: relative;
}

.ftm-pp-table tbody .ftm-pp-row:hover {
    background: rgba(245,158,11,.04);
}

.ftm-pp-table tbody .ftm-pp-row td {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    font-size: 12px;
    vertical-align: middle;
    color: var(--ftm-text-secondary);
    font-family: var(--ftm-mono);
}

.ftm-pp-table tbody .ftm-pp-row:last-child td { border-bottom: none; }

/* Row entrance animation */
.ftm-pp-row-enter {
    animation: ftmPpRowFadeIn .4s cubic-bezier(.22,1,.36,1) backwards;
}

@keyframes ftmPpRowFadeIn {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* â”€â”€ Cell: Rank â”€â”€ */
.ftm-ppd-rank { text-align: center; }

.ftm-pp-rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 4px;
    border-radius: 6px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    font-size: 10px;
    font-weight: 600;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-mono);
}

/* Medals for top 3 */
.ftm-pp-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--ftm-mono);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.ftm-pp-gold {
    background: linear-gradient(135deg, #f59e0b, #eab308);
    color: #1a1a2e;
    box-shadow: 0 2px 12px rgba(245,158,11,.4);
}

.ftm-pp-silver {
    background: linear-gradient(135deg, #94a3b8, #cbd5e1);
    color: #1a1a2e;
    box-shadow: 0 2px 12px rgba(148,163,184,.3);
}

.ftm-pp-bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    box-shadow: 0 2px 12px rgba(217,119,6,.3);
}

/* â”€â”€ Cell: Pair â”€â”€ */
.ftm-ppd-pair { font-family: var(--ftm-font) !important; }

.ftm-pp-pair-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ftm-pp-pair-name {
    font-weight: 600;
    color: var(--ftm-text);
    font-size: 12px;
}

/* â”€â”€ Cell: Trades â”€â”€ */
.ftm-ppd-trades { text-align: center; }

.ftm-pp-trades-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(59,130,246,.08);
    border: 1px solid rgba(59,130,246,.15);
    color: var(--ftm-accent);
    font-weight: 700;
    font-size: 11px;
    font-family: var(--ftm-mono);
}

/* â”€â”€ Cell: Total Profit â”€â”€ */
.ftm-ppd-profit {
    text-align: right;
    font-weight: 700;
}

.ftm-ppd-profit.ftm-profit-positive { color: #10b981 !important; }
.ftm-ppd-profit.ftm-profit-negative { color: #ef4444 !important; }

/* â”€â”€ Cell: Avg Profit % â”€â”€ */
.ftm-ppd-avgpct { text-align: center; }

.ftm-pp-avg-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--ftm-mono);
    transition: transform .15s;
}

.ftm-pp-avg-chip:hover { transform: scale(1.05); }

.ftm-pp-avg-chip.ftm-profit-positive {
    background: rgba(16,185,129,.1) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16,185,129,.2);
}

.ftm-pp-avg-chip.ftm-profit-negative {
    background: rgba(239,68,68,.1) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239,68,68,.2);
}

/* â”€â”€ Cell: Wins â”€â”€ */
.ftm-ppd-wins {
    text-align: center;
    color: #10b981 !important;
    font-weight: 600;
}

/* â”€â”€ Cell: Losses â”€â”€ */
.ftm-ppd-losses {
    text-align: center;
    color: #ef4444 !important;
    font-weight: 600;
}

/* â”€â”€ Cell: Win Rate with Bar â”€â”€ */
.ftm-ppd-winrate { text-align: center; }

.ftm-pp-wr-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    height: 24px;
    border-radius: 4px;
    background: rgba(255,255,255,.03);
    overflow: hidden;
}

.ftm-pp-wr-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 4px;
    transition: width .6s cubic-bezier(.22,1,.36,1);
}

.ftm-pp-wr-bar.ftm-wr-high {
    background: rgba(16,185,129,.2);
}

.ftm-pp-wr-bar.ftm-wr-mid {
    background: rgba(245,158,11,.2);
}

.ftm-pp-wr-bar.ftm-wr-low {
    background: rgba(239,68,68,.2);
}

.ftm-pp-wr-text {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 11px;
    font-family: var(--ftm-mono);
    color: var(--ftm-text);
}

/* â”€â”€ Empty State â”€â”€ */
.ftm-pp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-font);
}

.ftm-pp-empty-state svg { opacity: .25; color: var(--ftm-yellow); }
.ftm-pp-empty-state span { font-size: 14px; font-weight: 500; }

/* â”€â”€ Responsive: Pair Performance (handled by main mobile CSS block) â”€â”€ */

/* â”€â”€â”€â”€ AI Price Engine: Live Indicators & Animations â”€â”€â”€â”€ */

/* â”€â”€â”€ Live Price Cell â”€â”€â”€ */
.ftm-live-price {
    text-align: right;
    font-variant-numeric: tabular-nums;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap;
}

/* Digit container */
.ftm-price-digits {
    display: inline-block;
    transition: color .3s;
}

/* â”€â”€â”€ Directional Arrow Indicators â”€â”€â”€ */
.ftm-price-arrow {
    display: inline-block;
    font-size: 9px;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0;
    animation: ftmArrowAppear .3s ease-out forwards;
}

.ftm-arrow-up {
    color: #10b981;
    text-shadow: 0 0 8px rgba(16,185,129,.4);
    animation: ftmArrowAppear .3s ease-out forwards, ftmArrowBounceUp .5s ease-out;
}

.ftm-arrow-down {
    color: #ef4444;
    text-shadow: 0 0 8px rgba(239,68,68,.4);
    animation: ftmArrowAppear .3s ease-out forwards, ftmArrowBounceDown .5s ease-out;
}

@keyframes ftmArrowAppear {
    0%   { opacity: 0; transform: scale(0); }
    60%  { opacity: 1; transform: scale(1.3); }
    100% { opacity: .8; transform: scale(1); }
}

@keyframes ftmArrowBounceUp {
    0%   { transform: translateY(6px); }
    40%  { transform: translateY(-3px); }
    70%  { transform: translateY(1px); }
    100% { transform: translateY(0); }
}

@keyframes ftmArrowBounceDown {
    0%   { transform: translateY(-6px); }
    40%  { transform: translateY(3px); }
    70%  { transform: translateY(-1px); }
    100% { transform: translateY(0); }
}


/* â”€â”€â”€ Digit Roll Animation â”€â”€â”€ */
.ftm-price-roller {
    display: inline-flex;
    flex-direction: column;
    overflow: hidden;
    height: 1.4em;
    line-height: 1.4em;
    position: relative;
}

.ftm-price-old,
.ftm-price-new {
    display: block;
    height: 1.4em;
    line-height: 1.4em;
    white-space: nowrap;
}

/* Roll UP: old slides up/out, new slides up/in from below */
.ftm-price-roller.ftm-roll-up .ftm-price-old {
    animation: ftmRollOutUp .3s cubic-bezier(.4,0,.2,1) forwards;
}
.ftm-price-roller.ftm-roll-up .ftm-price-new {
    animation: ftmRollInUp .3s cubic-bezier(.4,0,.2,1) forwards;
    color: #10b981;
}

/* Roll DOWN: old slides down/out, new slides down/in from above */
.ftm-price-roller.ftm-roll-down .ftm-price-old {
    animation: ftmRollOutDown .3s cubic-bezier(.4,0,.2,1) forwards;
}
.ftm-price-roller.ftm-roll-down .ftm-price-new {
    animation: ftmRollInDown .3s cubic-bezier(.4,0,.2,1) forwards;
    color: #ef4444;
}

@keyframes ftmRollOutUp {
    0%   { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-100%); opacity: 0; }
}
@keyframes ftmRollInUp {
    0%   { transform: translateY(0); opacity: 0; }
    100% { transform: translateY(-100%); opacity: 1; }
}
@keyframes ftmRollOutDown {
    0%   { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}
@keyframes ftmRollInDown {
    0%   { transform: translateY(-200%); opacity: 0; }
    100% { transform: translateY(-100%); opacity: 1; }
}


/* â”€â”€â”€ Price Cell Flash: Neon Glow Pulse â”€â”€â”€ */
@keyframes ftmFlashUp {
    0%   {
        background: rgba(16,185,129,.3);
        color: #34d399;
        box-shadow: inset 0 0 20px rgba(16,185,129,.15), 0 0 12px rgba(16,185,129,.1);
    }
    40%  {
        background: rgba(16,185,129,.12);
        color: #10b981;
    }
    100% {
        background: transparent;
        color: inherit;
        box-shadow: none;
    }
}

@keyframes ftmFlashDown {
    0%   {
        background: rgba(239,68,68,.3);
        color: #f87171;
        box-shadow: inset 0 0 20px rgba(239,68,68,.15), 0 0 12px rgba(239,68,68,.1);
    }
    40%  {
        background: rgba(239,68,68,.12);
        color: #ef4444;
    }
    100% {
        background: transparent;
        color: inherit;
        box-shadow: none;
    }
}

.ftm-price-flash-up {
    animation: ftmFlashUp .9s cubic-bezier(.22,1,.36,1);
    border-radius: 4px;
}

.ftm-price-flash-down {
    animation: ftmFlashDown .9s cubic-bezier(.22,1,.36,1);
    border-radius: 4px;
}


/* â”€â”€â”€ Row-level Sweep Flash (gradient wipe across row) â”€â”€â”€ */
@keyframes ftmRowSweepUp {
    0%   {
        background-position: -100% 0;
        box-shadow: inset 3px 0 0 0 rgba(16,185,129,.6);
    }
    30%  {
        background-position: 0% 0;
    }
    100% {
        background-position: 200% 0;
        box-shadow: inset 3px 0 0 0 rgba(16,185,129,0);
    }
}

@keyframes ftmRowSweepDown {
    0%   {
        background-position: -100% 0;
        box-shadow: inset 3px 0 0 0 rgba(239,68,68,.6);
    }
    30%  {
        background-position: 0% 0;
    }
    100% {
        background-position: 200% 0;
        box-shadow: inset 3px 0 0 0 rgba(239,68,68,0);
    }
}

.ftm-row-flash-up {
    background-image: linear-gradient(90deg,
        transparent 0%,
        rgba(16,185,129,.06) 30%,
        rgba(16,185,129,.1) 50%,
        rgba(16,185,129,.06) 70%,
        transparent 100%);
    background-size: 100% 100%;
    animation: ftmRowSweepUp 1.2s cubic-bezier(.22,1,.36,1);
}

.ftm-row-flash-down {
    background-image: linear-gradient(90deg,
        transparent 0%,
        rgba(239,68,68,.06) 30%,
        rgba(239,68,68,.1) 50%,
        rgba(239,68,68,.06) 70%,
        transparent 100%);
    background-size: 100% 100%;
    animation: ftmRowSweepDown 1.2s cubic-bezier(.22,1,.36,1);
}


/* â”€â”€â”€ Momentum: Sustained Trend Row Effects â”€â”€â”€ */
.ftm-trend-bullish {
    box-shadow: inset 3px 0 0 0 rgba(16,185,129,.5);
    background: linear-gradient(90deg, rgba(16,185,129,.03) 0%, transparent 30%);
    transition: box-shadow .4s, background .4s;
}

.ftm-trend-bearish {
    box-shadow: inset 3px 0 0 0 rgba(239,68,68,.5);
    background: linear-gradient(90deg, rgba(239,68,68,.03) 0%, transparent 30%);
    transition: box-shadow .4s, background .4s;
}


/* â”€â”€â”€ LIVE Badge (heading indicator) â”€â”€â”€ */
.ftm-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 3px 12px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(16,185,129,.15) 0%, rgba(6,182,212,.08) 100%);
    border: 1px solid rgba(16,185,129,.2);
    color: #10b981;
    vertical-align: middle;
    line-height: 1;
    font-family: var(--ftm-font);
    position: relative;
    overflow: hidden;
    animation: ftmBadgePop .4s cubic-bezier(.22,1,.36,1);
}

/* Scanner sweep across LIVE badge */
.ftm-live-badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16,185,129,.15), transparent);
    animation: ftmBadgeScan 3s ease-in-out infinite;
}

@keyframes ftmBadgePop {
    0%   { opacity: 0; transform: scale(.7); }
    60%  { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes ftmBadgeScan {
    0%   { left: -100%; }
    50%  { left: 100%; }
    100% { left: 100%; }
}

/* Pulsing live dot */
.ftm-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 4px rgba(16,185,129,.5);
    animation: ftmLiveDotPulse 1.8s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes ftmLiveDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 4px rgba(16,185,129,.5); }
    50%      { opacity: .5; transform: scale(.6); box-shadow: 0 0 8px rgba(16,185,129,.3); }
}


/* â”€â”€â”€ P/L Value Animations â”€â”€â”€ */
.ftm-pnl-value {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    transition: transform .25s cubic-bezier(.22,1,.36,1), color .3s;
}

.ftm-live-pnl-pct {
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: color .3s ease;
    position: relative;
}

.ftm-live-pnl-abs {
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: color .3s ease;
    position: relative;
}

/* P/L cells glow on profit/loss change */
.ftm-live-pnl-abs.ftm-profit-positive .ftm-pnl-value {
    color: #10b981;
    font-weight: 700;
}

.ftm-live-pnl-abs.ftm-profit-negative .ftm-pnl-value {
    color: #ef4444;
    font-weight: 700;
}

/* P/L Chip colors handled by .ftm-pnl-chip class */

/* â”€â”€ End Price Engine CSS â”€â”€ */

/* ---- Pagination ---- */
.ftm-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}

.ftm-pagination button {
    padding: 6px 14px;
    border: 1px solid var(--ftm-border);
    background: transparent;
    color: var(--ftm-text-secondary);
    border-radius: var(--ftm-radius-xs);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--ftm-transition);
    font-family: var(--ftm-font);
}

.ftm-pagination button:hover {
    background: var(--ftm-bg-elevated);
    border-color: var(--ftm-border-light);
}

.ftm-pagination button.active {
    background: var(--ftm-accent);
    border-color: var(--ftm-accent);
    color: #fff;
}

.ftm-pagination button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ---- Error State ---- */
.ftm-error {
    text-align: center;
    padding: 48px 24px;
    color: var(--ftm-text-muted);
    font-size: 15px;
}

.ftm-no-data {
    text-align: center;
    padding: 64px 24px;
    color: var(--ftm-text-muted);
}

.ftm-no-data svg {
    width: 64px;
    height: 64px;
    color: var(--ftm-text-muted);
    margin-bottom: 16px;
    opacity: .5;
}

.ftm-no-data h3 {
    font-size: 20px;
    margin: 0 0 8px;
    color: var(--ftm-text-secondary);
}

.ftm-no-data p {
    font-size: 14px;
}

/* ---- Scrollbar ---- */
.ftm-dashboard ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.ftm-dashboard ::-webkit-scrollbar-track {
    background: transparent;
}

.ftm-dashboard ::-webkit-scrollbar-thumb {
    background: var(--ftm-border-light);
    border-radius: 3px;
}

.ftm-dashboard ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .2);
}

/* ---- Table Responsive Scroll ---- */
.ftm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Responsive Design ---- */
/* 1400px+: All grids auto-fit fluid â€” no override needed */

@media (max-width: 1200px) {
    .ftm-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    }
}

@media (max-width: 1024px) {
    .ftm-dashboard {
        padding: 16px;
    }
    
    .ftm-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .ftm-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Old 768px/480px rules removed â€” see comprehensive Mobile PWA section at end of file */

/* ---- Print Styles ---- */
@media print {
    body.ftm-dashboard-page {
        background: #fff !important;
        color: #000 !important;
    }
    
    .ftm-dashboard::before,
    .ftm-status-bar,
    .ftm-chart-controls,
    .ftm-table-controls,
    .ftm-pagination {
        display: none !important;
    }
    
    .ftm-summary-card,
    .ftm-chart-container,
    .ftm-info-card,
    .ftm-table-wrap {
        border: 1px solid #ddd !important;
        background: #fff !important;
        color: #000 !important;
        break-inside: avoid;
    }
    
    .ftm-card-value,
    .ftm-info-value,
    .ftm-table td {
        color: #000 !important;
    }
}

/* ============================================================
   Sequential Loading Animation System
   - Gated behind .ftm-loaded to prevent animations before data
   - Skeleton shimmer placeholders while loading
   - Fast staggered reveal (0.3s total cascade, not 0.85s)
   - Tab panel transitions
   ============================================================ */

/* ---- Core animation keyframes ---- */
@keyframes ftmFadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ftmFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-8px); }
}

@keyframes ftmShimmerPulse {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ---- Skeleton shimmer while data is loading ---- */
.ftm-dashboard:not(.ftm-loaded) .ftm-card-value,
.ftm-dashboard:not(.ftm-loaded) .ftm-card-sub {
    color: transparent !important;
    background: linear-gradient(90deg,
        rgba(255,255,255,.04) 25%,
        rgba(255,255,255,.1) 50%,
        rgba(255,255,255,.04) 75%);
    background-size: 200% 100%;
    animation: ftmShimmerPulse 1.6s ease-in-out infinite;
    border-radius: 4px;
    min-width: 48px;
    min-height: 1.15em;
    display: inline-block;
}

.ftm-dashboard:not(.ftm-loaded) .ftm-info-value {
    color: transparent !important;
    background: linear-gradient(90deg,
        rgba(255,255,255,.03) 25%,
        rgba(255,255,255,.07) 50%,
        rgba(255,255,255,.03) 75%);
    background-size: 200% 100%;
    animation: ftmShimmerPulse 1.6s ease-in-out infinite;
    border-radius: 4px;
    min-width: 36px;
    min-height: 1em;
    display: inline-block;
}

.ftm-dashboard:not(.ftm-loaded) .ftm-cred-label,
.ftm-dashboard:not(.ftm-loaded) .ftm-status-text {
    color: transparent !important;
    background: linear-gradient(90deg,
        rgba(255,255,255,.04) 25%,
        rgba(255,255,255,.09) 50%,
        rgba(255,255,255,.04) 75%);
    background-size: 200% 100%;
    animation: ftmShimmerPulse 1.6s ease-in-out infinite;
    border-radius: 4px;
    min-width: 80px;
    display: inline-block;
}

.ftm-dashboard:not(.ftm-loaded) .ftm-empty {
    color: transparent !important;
    position: relative;
}
.ftm-dashboard:not(.ftm-loaded) .ftm-empty::after {
    content: '';
    position: absolute;
    inset: 8px 20%;
    border-radius: 4px;
    background: linear-gradient(90deg,
        rgba(255,255,255,.03) 25%,
        rgba(255,255,255,.07) 50%,
        rgba(255,255,255,.03) 75%);
    background-size: 200% 100%;
    animation: ftmShimmerPulse 1.6s ease-in-out infinite;
}

/* Clear shimmer once loaded */
.ftm-dashboard.ftm-loaded .ftm-card-value,
.ftm-dashboard.ftm-loaded .ftm-card-sub,
.ftm-dashboard.ftm-loaded .ftm-info-value,
.ftm-dashboard.ftm-loaded .ftm-cred-label,
.ftm-dashboard.ftm-loaded .ftm-status-text {
    background: none !important;
    min-width: unset;
    min-height: unset;
}

/* ---- All animatable sections start invisible until .ftm-loaded ---- */
.ftm-dashboard:not(.ftm-loaded) .ftm-summary-card,
.ftm-dashboard:not(.ftm-loaded) .ftm-chart-container,
.ftm-dashboard:not(.ftm-loaded) .ftm-info-card,
.ftm-dashboard:not(.ftm-loaded) .ftm-ot-section,
.ftm-dashboard:not(.ftm-loaded) .ftm-ct-section,
.ftm-dashboard:not(.ftm-loaded) .ftm-pp-section {
    opacity: 0;
    transform: translateY(14px);
}

/* ---- Staggered reveal cascade on .ftm-loaded ---- */
.ftm-dashboard.ftm-loaded .ftm-summary-card,
.ftm-dashboard.ftm-loaded .ftm-chart-container,
.ftm-dashboard.ftm-loaded .ftm-info-card,
.ftm-dashboard.ftm-loaded .ftm-ot-section,
.ftm-dashboard.ftm-loaded .ftm-ct-section,
.ftm-dashboard.ftm-loaded .ftm-pp-section {
    animation: ftmFadeInUp .35s cubic-bezier(.22, 1, .36, 1) both;
}

/* Summary cards: fast 25ms stagger */
.ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(1) { animation-delay: 0s; }
.ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(2) { animation-delay: .025s; }
.ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(3) { animation-delay: .05s; }
.ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(4) { animation-delay: .075s; }
.ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(5) { animation-delay: .1s; }
.ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(6) { animation-delay: .125s; }

/* Open trades section */
.ftm-dashboard.ftm-loaded .ftm-ot-section { animation-delay: .06s; }

/* Info cards */
.ftm-dashboard.ftm-loaded .ftm-info-card:nth-child(1) { animation-delay: .1s; }
.ftm-dashboard.ftm-loaded .ftm-info-card:nth-child(2) { animation-delay: .13s; }
.ftm-dashboard.ftm-loaded .ftm-info-card:nth-child(3) { animation-delay: .16s; }

/* Chart containers */
.ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(1) { animation-delay: .12s; }
.ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(2) { animation-delay: .15s; }
.ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(3) { animation-delay: .18s; }
.ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(4) { animation-delay: .21s; }
.ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(5) { animation-delay: .24s; }

/* Closed trades & pair perf */
.ftm-dashboard.ftm-loaded .ftm-ct-section { animation-delay: .18s; }
.ftm-dashboard.ftm-loaded .ftm-pp-section { animation-delay: .22s; }

/* ---- Tab panel smooth transitions ---- */
.ftm-tab-panel.ftm-panel-exit {
    display: block !important;
    animation: ftmPanelExit .2s cubic-bezier(.4,0,1,1) forwards;
    pointer-events: none;
}
@keyframes ftmPanelExit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-10px) scale(0.99); }
}

/* ---- Utility Classes ---- */
.ftm-text-green { color: var(--ftm-green) !important; }
.ftm-text-red { color: var(--ftm-red) !important; }
.ftm-text-yellow { color: var(--ftm-yellow) !important; }
.ftm-text-accent { color: var(--ftm-accent) !important; }
.ftm-text-muted { color: var(--ftm-text-muted) !important; }
.ftm-font-mono { font-family: var(--ftm-mono) !important; }
.ftm-font-bold { font-weight: 700 !important; }

/* ---- Profit Color Classes ---- */
.ftm-profit-positive:not(.ftm-ot-row) { color: var(--ftm-green) !important; }
.ftm-profit-negative:not(.ftm-ot-row) { color: var(--ftm-red) !important; }

/* ---- Pair Icon Badge (non-OT tables) ---- */
.ftm-pair-cell:not(.ftm-ot-table .ftm-pair-cell) {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ftm-pair-icon:not(.ftm-ot-table .ftm-pair-icon) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(59,130,246,.12);
    color: var(--ftm-accent);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--ftm-font);
    flex-shrink: 0;
}

/* ---- Pagination Extras ---- */
.ftm-page-info {
    font-size: 12px;
    color: var(--ftm-text-muted);
    font-family: var(--ftm-font);
}

.ftm-page-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.ftm-page-btn {
    padding: 5px 12px;
    border: 1px solid var(--ftm-border);
    background: transparent;
    color: var(--ftm-text-secondary);
    border-radius: var(--ftm-radius-xs);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--ftm-transition);
    font-family: var(--ftm-font);
}

.ftm-page-btn:hover {
    background: var(--ftm-bg-elevated);
    border-color: var(--ftm-border-light);
}

.ftm-page-btn.active {
    background: var(--ftm-accent);
    border-color: var(--ftm-accent);
    color: #fff;
}

.ftm-page-dots {
    color: var(--ftm-text-muted);
    padding: 0 4px;
    line-height: 30px;
}

/* ---- Syncing animation ---- */
.ftm-syncing {
    animation: ftmSyncPulse 1.5s ease-in-out infinite;
}

@keyframes ftmSyncPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â–ˆâ–ˆ  MOBILE PWA â€“ Next-Gen Responsive UI System
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â€¢ Touch-optimized swipe tab navigation
   â€¢ Fluid card transforms & stagger animations
   â€¢ Smart table card-view for small screens
   â€¢ Safe-area inset support for notched devices
   â€¢ GPU-accelerated transitions (transform + opacity only)
   â€¢ 60fps scroll & touch interactions
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* ---- Global Mobile Touch Optimizations ---- */
@media (hover: none) and (pointer: coarse) {
    * { -webkit-tap-highlight-color: transparent; }
    button, a, .ftm-tab-link, .ftm-summary-card, .ftm-page-btn {
        touch-action: manipulation;
    }
    /* Larger touch targets */
    .ftm-tab-link { min-height: 44px; display: inline-flex; align-items: center; }
    .ftm-page-btn { min-height: 44px; min-width: 44px; }
}

/* ---- Safe Area Insets for Notched Devices ---- */
@supports (padding: env(safe-area-inset-top)) {
    .ftm-dashboard {
        padding-left: max(env(safe-area-inset-left), clamp(16px, 2vw, 40px));
        padding-right: max(env(safe-area-inset-right), clamp(16px, 2vw, 40px));
    }
    .ftm-template-footer {
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

/* ---- Swipe Tab Container System ---- */
.ftm-swipe-indicator {
    display: none;
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   NEXT-GEN MOBILE CAROUSEL SLIDER SYSTEM
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   â€¢ Every module row â†’ horizontal swipeable carousel
   â€¢ 3D coverflow depth effect with parallax
   â€¢ Per-row indicator dots with morphing animation
   â€¢ Spring-physics CSS transitions
   â€¢ Full-width slide cards with active glow
   â€¢ Safe area + notch support
   â€¢ 768px / 480px / 360px responsive cascade
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* ======== MOBILE BREAKPOINT: 768px ======== */
@media (max-width: 768px) {

    /* â”€â”€ Dashboard Container â”€â”€ */
    .ftm-dashboard {
        padding: 10px 0 24px;
        overflow-x: hidden;
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       CAROUSEL ROW ENGINE
       All grids â†’ horizontal scroll-snap flex
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-summary-grid,
    .ftm-info-grid,
    .ftm-charts-grid,
    .ftm-tables-carousel {
        display: flex !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 14px;
        padding: 6px 20px 6px;
        perspective: 1200px;
        position: relative;
    }

    .ftm-summary-grid::-webkit-scrollbar,
    .ftm-info-grid::-webkit-scrollbar,
    .ftm-charts-grid::-webkit-scrollbar,
    .ftm-tables-carousel::-webkit-scrollbar {
        display: none;
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       SUMMARY CARD SLIDES â€” 6 slides, 75vw
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-summary-card {
        min-width: 72vw;
        max-width: 72vw;
        scroll-snap-align: center;
        flex-shrink: 0;
        border-radius: 22px;
        padding: 22px 20px;
        transition: transform 0.6s cubic-bezier(.22, 1, .36, 1),
                    opacity 0.55s cubic-bezier(.25, .46, .45, .94),
                    box-shadow 0.6s ease,
                    filter 0.55s ease,
                    border-color 0.5s ease;
        will-change: transform, opacity;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .ftm-summary-card.ftm-card-featured {
        grid-column: auto !important;
    }

    .ftm-card-value { font-size: 28px; line-height: 1.15; }
    .ftm-card-label { font-size: 11.5px; letter-spacing: 0.8px; }
    .ftm-card-sub { font-size: 11.5px; margin-top: 5px; }
    .ftm-card-icon { width: 40px; height: 40px; min-width: 40px; border-radius: 12px; }
    .ftm-card-icon svg { width: 20px; height: 20px; }

    /* Per-card active glow — uses each card's own accent color */
    .ftm-summary-card.ftm-slide-active {
        border-color: rgba(var(--_rgb), 0.18) !important;
        box-shadow: 0 8px 40px rgba(var(--_rgb), 0.18),
                    0 0 0 1px rgba(var(--_rgb), 0.10),
                    inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
    .ftm-summary-card.ftm-slide-active::before {
        height: 3px !important;
        opacity: 1 !important;
    }
    .ftm-summary-card.ftm-slide-active::after {
        opacity: 1 !important;
    }
    .ftm-summary-card.ftm-slide-active .ftm-card-icon {
        background: rgba(var(--_rgb), 0.14);
        box-shadow: 0 0 16px rgba(var(--_rgb), 0.15);
    }
    .ftm-summary-card.ftm-slide-active .ftm-card-value {
        text-shadow: 0 0 30px rgba(var(--_rgb), 0.12);
    }

    /* Auto-slide progress bar */
    .ftm-auto-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        height: 2px;
        background: linear-gradient(90deg, rgba(var(--_rgb), 0.6), rgba(var(--_rgb), 0.2));
        border-radius: 0 0 22px 22px;
        z-index: 5;
        pointer-events: none;
    }
    .ftm-auto-progress.ftm-progress-running {
        animation: ftmAutoProgress var(--ftm-auto-duration, 4s) linear forwards;
    }
    @keyframes ftmAutoProgress {
        from { width: 0%; }
        to { width: 100%; }
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       INFO CARD SLIDES â€” 3 slides, 85vw
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-info-card {
        min-width: 85vw;
        max-width: 85vw;
        scroll-snap-align: center;
        flex-shrink: 0;
        border-radius: 20px;
        transition: transform 0.55s cubic-bezier(.22, 1, .36, 1),
                    opacity 0.5s ease,
                    filter 0.5s ease;
        will-change: transform, opacity;
        backface-visibility: hidden;
    }

    .ftm-ic-header { padding: 14px 16px 10px; }
    .ftm-ic-accent-line { margin: 0 16px; }
    .ftm-info-grid-inner { padding: 4px 16px 14px; }
    .ftm-info-row { padding: 8px 6px; margin: 0 -6px; font-size: 12.5px; }
    .ftm-ir-icon { width: 12px; height: 12px; margin-right: 6px; }
    .ftm-ir-label { font-size: 12px; }
    .ftm-ir-value { font-size: 12.5px; }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       CHART SLIDES â€” 5 slides, 88vw
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-chart-container {
        min-width: 88vw;
        max-width: 88vw;
        scroll-snap-align: center;
        flex-shrink: 0;
        border-radius: 20px;
        transition: transform 0.55s cubic-bezier(.22, 1, .36, 1),
                    opacity 0.5s ease,
                    filter 0.5s ease;
        will-change: transform, opacity;
        backface-visibility: hidden;
    }

    .ftm-chart-container.ftm-chart-large {
        grid-column: auto !important;
    }

    .ftm-cc-header {
        padding: 14px 16px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .ftm-cc-accent-line { margin: 0 16px; }
    .ftm-chart-scroll-wrap { padding: 8px 12px 12px; }
    .ftm-cc-winloss > canvas { padding: 8px 12px 12px; }
    .ftm-chart-controls {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
        gap: 4px;
    }
    .ftm-chart-controls::-webkit-scrollbar { display: none; }
    .ftm-chart-controls .ftm-chart-btn {
        flex-shrink: 0;
        font-size: 10.5px;
        padding: 5px 10px;
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       TABLE SECTION SLIDES â€” 92vw
       (CT + PP grouped in .ftm-tables-carousel)
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-tables-carousel > .ftm-section,
    .ftm-tables-carousel > .ftm-pp-section {
        min-width: 92vw;
        max-width: 92vw;
        scroll-snap-align: center;
        flex-shrink: 0;
        border-radius: 20px;
        transition: transform 0.55s cubic-bezier(.22, 1, .36, 1),
                    opacity 0.5s ease,
                    filter 0.5s ease;
        will-change: transform, opacity;
        backface-visibility: hidden;
    }

    /* OT section: standalone full-width card */
    .ftm-ot-section {
        border-radius: 0;
        margin: 0;
        overflow: visible;
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       3D COVERFLOW DEPTH SYSTEM
       Active = full glory, adjacent = recessed,
       distant = deep background
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-slide-active {
        transform: scale(1) translateZ(0) rotateY(0deg) !important;
        opacity: 1 !important;
        filter: brightness(1) blur(0px) !important;
        z-index: 2;
    }

    .ftm-slide-prev {
        transform: scale(0.90) translateX(8px) translateZ(-40px) rotateY(3deg) !important;
        opacity: 0.55 !important;
        filter: brightness(0.78) blur(0.5px) !important;
        z-index: 1;
    }

    .ftm-slide-next {
        transform: scale(0.90) translateX(-8px) translateZ(-40px) rotateY(-3deg) !important;
        opacity: 0.55 !important;
        filter: brightness(0.78) blur(0.5px) !important;
        z-index: 1;
    }

    .ftm-slide-distant {
        transform: scale(0.80) translateZ(-80px) rotateY(0deg) !important;
        opacity: 0.15 !important;
        filter: brightness(0.55) blur(2px) !important;
        z-index: 0;
    }


    /* Crossfade transition: seamless wrap from last slide to first */
    .ftm-crossfade-out {
        animation: ftmCrossfadeOut 0.32s cubic-bezier(.4, 0, .2, 1) forwards;
        z-index: 3 !important;
        position: relative;
    }
    .ftm-crossfade-in {
        opacity: 0 !important;
        transform: scale(0.92) translateZ(0) !important;
        filter: blur(0px) !important;
    }
    .ftm-crossfade-reveal {
        animation: ftmCrossfadeIn 0.32s cubic-bezier(.4, 0, .2, 1) forwards;
        z-index: 2 !important;
    }

    @keyframes ftmCrossfadeOut {
        0% {
            opacity: 1;
            transform: scale(1) translateZ(0);
            filter: blur(0px);
        }
        100% {
            opacity: 0;
            transform: scale(0.94) translateZ(-30px);
            filter: blur(2px);
        }
    }
    @keyframes ftmCrossfadeIn {
        0% {
            opacity: 0;
            transform: scale(0.92) translateZ(-20px);
            filter: blur(1px);
        }
        100% {
            opacity: 1;
            transform: scale(1) translateZ(0);
            filter: blur(0px);
        }
    }

    /* â”€â”€ Active Slide Glow Effects â”€â”€ */
    .ftm-info-card.ftm-slide-active {
        box-shadow: 0 12px 48px rgba(0, 212, 170, 0.10),
                    0 0 0 1px rgba(0, 212, 170, 0.05),
                    inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .ftm-chart-container.ftm-slide-active {
        box-shadow: 0 12px 48px rgba(0, 212, 170, 0.10),
                    inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }

    .ftm-tables-carousel > .ftm-slide-active {
        box-shadow: 0 12px 48px rgba(0, 212, 170, 0.08);
    }

        /* Active Slide Accent Border Glow - scoped to avoid overwriting summary card accent stripes */
    .ftm-info-card.ftm-slide-active::before,
    .ftm-chart-container.ftm-slide-active::before,
    .ftm-tables-carousel > .ftm-slide-active::before {
        content: '';
        position: absolute;
        inset: -1px;
        border-radius: inherit;
        padding: 1px;
        background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), transparent 60%);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
        opacity: 1;
        transition: opacity 0.5s ease;
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       CAROUSEL INDICATOR DOTS
       Morphing pill dots with gradient
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-carousel-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px;
        padding: 10px 16px 4px;
    }

    .ftm-carousel-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        border: none;
        padding: 0;
        cursor: pointer;
        transition: width 0.45s cubic-bezier(.22, 1, .36, 1),
                    border-radius 0.45s cubic-bezier(.22, 1, .36, 1),
                    background 0.4s ease,
                    box-shadow 0.4s ease,
                    transform 0.3s ease;
    }

    .ftm-carousel-dot:active {
        transform: scale(0.85);
    }

    .ftm-carousel-dot.active {
        width: 24px;
        border-radius: 4px;
        background: linear-gradient(135deg, #00d4aa, #00b894);
        box-shadow: 0 0 12px rgba(0, 212, 170, 0.4),
                    0 2px 6px rgba(0, 212, 170, 0.2);
    }

    /* Auto-slide play/pause toggle */
    .ftm-auto-toggle {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 1.5px solid rgba(255,255,255,0.15);
        background: rgba(255,255,255,0.04);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin-left: 6px;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }
    .ftm-auto-toggle:active { transform: scale(0.9); }
    .ftm-auto-toggle svg { width: 10px; height: 10px; fill: rgba(255,255,255,0.5); }
    .ftm-auto-toggle.ftm-auto-playing { border-color: rgba(0,212,170,0.3); background: rgba(0,212,170,0.08); }
    .ftm-auto-toggle.ftm-auto-playing svg { fill: #00d4aa; }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       CAROUSEL ROW HEADER & COUNTER
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-carousel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px 2px;
    }

    .ftm-carousel-title {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.8px;
        color: rgba(255, 255, 255, 0.28);
    }

    .ftm-carousel-counter {
        font-size: 11px;
        font-weight: 800;
        font-variant-numeric: tabular-nums;
        color: var(--ftm-accent);
        letter-spacing: 0.5px;
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       SWIPE HINT (shown once, auto-fades)
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-swipe-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 4px 0 8px;
        font-size: 9.5px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.2);
        letter-spacing: 3px;
        text-transform: uppercase;
        animation: ftmHintFadeOut 5s ease forwards;
        pointer-events: none;
    }

    .ftm-swipe-hint-arrow {
        display: inline-block;
        animation: ftmHintBounce 1.2s cubic-bezier(.22, 1, .36, 1) infinite;
    }

    .ftm-swipe-hint-arrow.left {
        animation-name: ftmHintBounceLeft;
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       STATUS BAR MOBILE LAYOUT
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-status-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
        gap: 8px;
        border-radius: 16px;
        position: relative;
        top: auto;
        z-index: 50;
        background: linear-gradient(145deg, rgba(14,20,36,.95), rgba(18,24,46,.92));
        backdrop-filter: blur(28px) saturate(180%);
        -webkit-backdrop-filter: blur(28px) saturate(180%);
        border: 1px solid rgba(255,255,255,.08);
        margin: 0 8px 8px;
        box-shadow: 0 4px 24px rgba(0,0,0,.3), 0 1px 0 rgba(0,212,170,0.04) inset;
    }

    .ftm-status-hero {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
    }

    .ftm-status-live-badge {
        flex-shrink: 0;
        padding: 3px 10px 3px 6px;
        gap: 7px;
    }
    .ftm-pulse-ring { width: 22px; height: 22px; }
    .ftm-pulse-core { width: 8px; height: 8px; }
    .ftm-cred-label { font-size: 12.5px; letter-spacing: .2px; }

    .ftm-status-info {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 12px;
    }
    .ftm-status-text {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
    .ftm-uptime-badge { font-size: 11.5px; padding: 3px 8px 3px 5px; }
    .ftm-uptime-badge svg { width: 11px; height: 11px; }

    .ftm-status-divider { display: none; }

    /* â”€â”€ Tab Navigation: Scroll Snap â”€â”€ */
    .ftm-status-tabs {
        display: flex;
        width: calc(100% + 28px);
        margin: 0 -14px;
        padding: 6px 14px 4px;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid rgba(255,255,255,0.06);
    }
    .ftm-status-tabs::-webkit-scrollbar { display: none; }

    .ftm-tab-link {
        scroll-snap-align: start;
        flex: 1 0 auto;
        padding: 8px 14px;
        font-size: 10.5px;
        font-weight: 600;
        border-radius: 10px;
        white-space: nowrap;
        justify-content: center;
        transition: color 0.3s, background 0.3s, transform 0.15s, box-shadow 0.3s;
        letter-spacing: .3px;
        text-transform: uppercase;
        min-height: 40px;
        gap: 6px;
        border: 1px solid transparent;
    }
    .ftm-tab-link svg { width: 12px; height: 12px; transition: opacity 0.3s, color 0.3s; }

    .ftm-tab-link:active {
        transform: scale(0.93);
        transition-duration: 0.08s;
    }

    .ftm-tab-link.active {
        background: linear-gradient(135deg, rgba(0,212,170,0.14), rgba(99,102,241,0.06));
        color: #00d4aa;
        border-color: rgba(0,212,170,0.18);
        box-shadow: 0 0 14px rgba(0,212,170,0.08),
                    0 0 4px rgba(0,212,170,0.04) inset;
        animation: ftmTabGlowPulse 3s ease-in-out infinite;
    }
    .ftm-tab-link.active svg { opacity: 1; color: #00d4aa; }
    .ftm-tab-link.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        border-radius: 2px;
        background: linear-gradient(90deg, transparent, #00d4aa, transparent);
        animation: ftmTabGlow 2.5s ease-in-out infinite;
    }

    /* Tab swipe dots */
    .ftm-swipe-indicator {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 6px 0 3px;
    }
    .ftm-swipe-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(255,255,255,0.15);
        transition: width 0.4s cubic-bezier(.22, 1, .36, 1),
                    border-radius 0.4s cubic-bezier(.22, 1, .36, 1),
                    background 0.4s ease,
                    box-shadow 0.4s ease;
    }
    .ftm-swipe-dot.active {
        width: 20px;
        border-radius: 3px;
        background: linear-gradient(135deg, #00d4aa, #00b894);
        box-shadow: 0 0 8px rgba(0, 212, 170, 0.35);
    }

    /* â”€â”€ Tab Panel Transitions â”€â”€ */
    .ftm-tab-panel {
        will-change: transform, opacity;
    }

    .ftm-tab-panel.active {
        animation: ftmSlideIn 0.4s cubic-bezier(.22, 1, .36, 1) forwards;
    }

    /* Directional slide based on swipe */
    [data-swipe-dir="left"] .ftm-tab-panel.active {
        animation-name: ftmSlideInFromRight;
    }
    [data-swipe-dir="right"] .ftm-tab-panel.active {
        animation-name: ftmSlideInFromLeft;
    }

    .ftm-tab-panel.ftm-panel-exit {
        animation: ftmSlideOut 0.2s ease forwards !important;
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       TABLE MOBILE INTERNALS
       (horizontal scroll, shadow hints, compact)
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

    .ftm-table-wrap {
        border-radius: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        position: relative;
    }

    /* Right scroll shadow */
    .ftm-table-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 32px;
        background: linear-gradient(90deg, transparent, rgba(5, 8, 22, 0.55));
        pointer-events: none;
        z-index: 2;
        opacity: 1;
        transition: opacity 0.3s;
        border-radius: 0;
    }
    .ftm-table-wrap.scrolled-end::after { opacity: 0; }

    /* Left scroll shadow */
    .ftm-table-wrap::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 32px;
        background: linear-gradient(270deg, transparent, rgba(5, 8, 22, 0.55));
        pointer-events: none;
        z-index: 2;
        opacity: 0;
        transition: opacity 0.3s;
        border-radius: 0;
    }
    .ftm-table-wrap.scrolled-start::before { opacity: 0; }
    .ftm-table-wrap.scrolled-mid::before { opacity: 1; }

    .ftm-table thead th {
        padding: 10px 10px;
        font-size: 9px;
        letter-spacing: 0.3px;
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 3;
    }

    .ftm-table tbody td {
        padding: 8px 10px;
        font-size: 11.5px;
        white-space: nowrap;
    }

    /* Section headers */
    .ftm-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 14px;
    }
    .ftm-section-title { font-size: 15px; }

    /* Table controls compact */
    .ftm-table-controls,
    .ftm-ot-controls,
    .ftm-ct-controls,
    .ftm-pp-controls {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .ftm-search-input,
    .ftm-ot-search,
    .ftm-ct-search-input,
    .ftm-pp-sort-select,
    .ftm-ct-filter-select {
        width: 100%;
        font-size: 13px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    /* Open Trades */
    .ftm-ot-title-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ftm-ot-summary-chip { width: 100%; justify-content: space-between; }
    .ftm-ot-table .ftm-pair-icon { width: 22px; height: 22px; font-size: 9px; }
    .ftm-pair-name { font-size: 11.5px; }

    /* OT table wrap mobile overrides */
    .ftm-ot-table-wrap {
        overflow-x: auto;
        overflow-y: visible;
        border-radius: 0;
        -webkit-overflow-scrolling: touch;
        box-shadow: none;
        border: none;
        background: transparent;
    }
    .ftm-ot-table-wrap::before,
    .ftm-ot-table-wrap::after {
        display: none !important; /* Kill ALL pseudo-element shadows — they scroll with content */
        content: none !important;
    }
    .ftm-ot-header {
        margin-bottom: 12px;
        padding: 0 4px;
    }
    .ftm-ot-icon-wrap {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }
    .ftm-ot-header h2 {
        font-size: 15px;
    }
    .ftm-ot-count-badge {
        font-size: 10px;
        padding: 2px 8px;
    }
    /* Profit indicator border-left fix for mobile */
    .ftm-ot-row.ftm-profit-positive,
    .ftm-ot-row.ftm-profit-negative {
        border-left-width: 3px;
    }
    /* Remove ALL inset/box shadows on mobile OT rows */
    .ftm-ot-table tbody .ftm-ot-row,
    .ftm-ot-table tbody .ftm-ot-row:hover {
        box-shadow: none !important;
        transition: background .25s ease;
    }
    /* Remove trend momentum shadows AND background gradients on mobile */
    .ftm-ot-table .ftm-trend-bullish,
    .ftm-ot-table .ftm-trend-bearish {
        box-shadow: none !important;
        background: none !important;
    }
    /* Disable row sweep effects entirely on mobile */
    .ftm-ot-table .ftm-row-flash-up,
    .ftm-ot-table .ftm-row-flash-down {
        box-shadow: none !important;
        background-image: none !important;
        animation: none !important;
    }

    /* Closed Trades */
    .ftm-ct-title-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ftm-ct-stats-strip {
        gap: 6px; padding: 10px 12px;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; flex-wrap: nowrap;
        -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
        mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    }
    .ftm-ct-stats-strip::-webkit-scrollbar { display: none; }
    .ftm-ct-stat { padding: 0 8px; min-width: 55px; flex-shrink: 0; }
    .ftm-ct-stat-value { font-size: 11px; }
    .ftm-ct-stat-label { font-size: 8.5px; }
    .ftm-ct-stat-divider { height: 18px; }

    /* Pair Performance */
    .ftm-pp-title-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ftm-pp-stats-strip {
        gap: 6px; padding: 10px 12px;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; flex-wrap: nowrap;
        -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
        mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    }
    .ftm-pp-stats-strip::-webkit-scrollbar { display: none; }
    .ftm-pp-stat { padding: 0 8px; min-width: 55px; flex-shrink: 0; }
    .ftm-pp-stat-value { font-size: 11px; }
    .ftm-pp-stat-label { font-size: 8.5px; }
    .ftm-pp-stat-divider { height: 18px; }
    .ftm-pp-medal { width: 20px; height: 20px; font-size: 8px; }
    .ftm-pp-wr-wrap { min-width: 60px; }

    /* Pagination */
    .ftm-pg-nav,
    .ftm-pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        padding: 10px 12px;
    }
    .ftm-page-btn {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* â”€â”€ Tab Content Cards â”€â”€ */
    .ftm-tab-content-card {
        padding: 16px 14px;
        border-radius: 16px;
        margin: 0 12px;
    }
    .ftm-tab-content-header { gap: 10px; margin-bottom: 18px; padding-bottom: 12px; }
    .ftm-tab-content-header h2 { font-size: 17px; }

    .ftm-about-grid,
    .ftm-support-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .ftm-support-link {
        padding: 14px 16px;
        border-radius: 12px;
        font-size: 14px;
    }

    /* Loading overlay */
    .ftm-loading-overlay { padding: 20px; }
    .ftm-loader p { font-size: 13px; }

    /* Footer */
    .ftm-template-footer {
        padding: 20px 12px;
        margin-top: 30px;
        font-size: 11px;
    }
}

/* ======== SMALL MOBILE: 480px ======== */
@media (max-width: 480px) {

    .ftm-dashboard { padding: 8px 0 20px; }

    /* Narrower slides */
    .ftm-summary-card {
        min-width: 76vw;
        max-width: 76vw;
        padding: 18px 16px;
    }
    .ftm-card-value { font-size: 24px; }

    .ftm-info-card {
        min-width: 88vw;
        max-width: 88vw;
    }

    .ftm-chart-container {
        min-width: 92vw;
        max-width: 92vw;
    }

    .ftm-tables-carousel > .ftm-section,
    .ftm-tables-carousel > .ftm-pp-section {
        min-width: 94vw;
        max-width: 94vw;
    }

    .ftm-ot-section { margin: 0; }

    /* Status bar compact */
    .ftm-status-bar {
        padding: 8px 10px;
        gap: 6px;
        margin: 0 6px 8px;
        border-radius: 14px;
    }

    .ftm-status-hero {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .ftm-status-live-badge {
        padding: 2px 8px 2px 5px;
        gap: 5px;
    }

    .ftm-pulse-ring { width: 20px; height: 20px; }
    .ftm-pulse-core { width: 7px; height: 7px; }
    .ftm-cred-label { font-size: 11.5px; }
    .ftm-status-text { font-size: 11.5px; max-width: 140px; }
    .ftm-uptime-badge { font-size: 11px; padding: 2px 7px 2px 4px; }
    .ftm-uptime-badge svg { width: 10px; height: 10px; }

    .ftm-tab-link { padding: 5px 10px; font-size: 10px; border-radius: 6px; }
    .ftm-tab-link svg { width: 10px; height: 10px; }

    /* Table text smaller */
    .ftm-table thead th { font-size: 8.5px; padding: 8px 8px; }
    .ftm-table tbody td { font-size: 11px; padding: 7px 8px; }

    /* Chart/Info compact */
    .ftm-chart-scroll-wrap { padding: 4px 8px 8px; }
    .ftm-cc-header { padding: 10px 12px 6px; }
    .ftm-cc-accent-line { margin: 0 12px; }
    .ftm-ic-header { padding: 10px 12px 6px; }
    .ftm-ic-accent-line { margin: 0 12px; }
    .ftm-info-grid-inner { padding: 2px 12px 10px; }
    .ftm-info-row { padding: 6px 4px; font-size: 11px; }

    /* Carousel adjustment */
    .ftm-summary-grid,
    .ftm-info-grid,
    .ftm-charts-grid,
    .ftm-tables-carousel {
        gap: 10px;
        padding: 4px 12px 4px;
    }

    .ftm-carousel-header { padding: 10px 14px 0; }
    .ftm-carousel-dots { padding: 8px 12px 2px; }

    .ftm-tab-content-card { margin: 0 8px; }
}

/* ======== EXTRA SMALL: 360px ======== */
@media (max-width: 360px) {
    .ftm-dashboard { padding: 6px 0 16px; }

    .ftm-summary-card {
        min-width: 82vw;
        max-width: 82vw;
        padding: 16px 14px;
        border-radius: 18px;
    }
    .ftm-card-value { font-size: 22px; }
    .ftm-card-label { font-size: 10.5px; }

    .ftm-info-card {
        min-width: 90vw;
        max-width: 90vw;
    }

    .ftm-chart-container {
        min-width: 94vw;
        max-width: 94vw;
    }

    .ftm-status-bar { padding: 7px 8px; gap: 5px; margin: 0 4px 6px; border-radius: 12px; }
    .ftm-tab-link { padding: 4px 8px; font-size: 9.5px; border-radius: 5px; }
    .ftm-cred-label { font-size: 11px; }
    .ftm-status-text { font-size: 11px; max-width: 110px; }
    .ftm-uptime-badge { font-size: 10.5px; }
    .ftm-pulse-ring { width: 18px; height: 18px; }
    .ftm-pulse-core { width: 6px; height: 6px; }
    .ftm-tab-content-card { padding: 12px 10px; margin: 0 6px; }
    .ftm-tab-content-header h2 { font-size: 15px; }

    .ftm-ot-section { margin: 0; }

    .ftm-summary-grid,
    .ftm-info-grid,
    .ftm-charts-grid,
    .ftm-tables-carousel {
        gap: 8px;
        padding: 4px 10px;
    }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   CAROUSEL SLIDE ANIMATIONS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Tab panel transitions */
@keyframes ftmSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes ftmSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-40px); }
}

/* Directional tab swipe */
@keyframes ftmSlideInFromRight {
    from { opacity: 0; transform: translateX(80px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes ftmSlideInFromLeft {
    from { opacity: 0; transform: translateX(-80px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* Swipe hint animations */
@keyframes ftmHintBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

@keyframes ftmHintBounceLeft {
    0%, 100% { transform: translateX(0) scaleX(-1); }
    50% { transform: translateX(-8px) scaleX(-1); }
}

/* Active tab glow underline pulse — uses filter for overflow:hidden compatibility */
@keyframes ftmTabGlow {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 4px rgba(0, 212, 170, 0.3)); }
    50% { opacity: 0.6; filter: drop-shadow(0 0 8px rgba(0, 212, 170, 0.6)); }
}

/* Tab tap ripple effect */
@keyframes ftmTabRipple {
    0% { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(4); opacity: 0; }
}

/* Tab active bounce entrance */
@keyframes ftmTabActivate {
    0% { transform: scale(0.92); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

/* Tab active glow pulse */
@keyframes ftmTabGlowPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(0,212,170,0.08), 0 0 6px rgba(0,212,170,0.04) inset; }
    50% { box-shadow: 0 0 24px rgba(0,212,170,0.12), 0 0 10px rgba(0,212,170,0.06) inset; }
}

@keyframes ftmHintFadeOut {
    0%, 50% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   CAROUSEL ENTRANCE ANIMATIONS
   Cards fly in with staggered spring physics
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

@keyframes ftmCarouselSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100px) scale(0.8) rotateY(-10deg);
        filter: blur(4px);
    }
    60% {
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1) rotateY(0deg);
        filter: blur(0px);
    }
}

@media (max-width: 768px) {
    /* Summary carousel entrance */
    .ftm-dashboard.ftm-loaded .ftm-summary-card {
        animation: ftmCarouselSlideIn 0.6s cubic-bezier(.22, 1, .36, 1) both;
    }
    .ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(1) { animation-delay: 0s; }
    .ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(2) { animation-delay: .06s; }
    .ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(3) { animation-delay: .12s; }
    .ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(4) { animation-delay: .18s; }
    .ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(5) { animation-delay: .24s; }
    .ftm-dashboard.ftm-loaded .ftm-summary-card:nth-child(6) { animation-delay: .30s; }

    /* Info carousel entrance */
    .ftm-dashboard.ftm-loaded .ftm-info-card {
        animation: ftmCarouselSlideIn 0.6s cubic-bezier(.22, 1, .36, 1) both;
    }
    .ftm-dashboard.ftm-loaded .ftm-info-card:nth-child(1) { animation-delay: .1s; }
    .ftm-dashboard.ftm-loaded .ftm-info-card:nth-child(2) { animation-delay: .18s; }
    .ftm-dashboard.ftm-loaded .ftm-info-card:nth-child(3) { animation-delay: .26s; }

    /* Charts carousel entrance */
    .ftm-dashboard.ftm-loaded .ftm-chart-container {
        animation: ftmCarouselSlideIn 0.6s cubic-bezier(.22, 1, .36, 1) both;
    }
    .ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(1) { animation-delay: .08s; }
    .ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(2) { animation-delay: .14s; }
    .ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(3) { animation-delay: .20s; }
    .ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(4) { animation-delay: .26s; }
    .ftm-dashboard.ftm-loaded .ftm-chart-container:nth-child(5) { animation-delay: .32s; }

    /* OT standalone entrance */
    .ftm-dashboard.ftm-loaded .ftm-ot-section {
        animation: ftmCarouselSlideIn 0.5s cubic-bezier(.22, 1, .36, 1) .1s both;
        overflow: visible;
    }

    /* Tables carousel entrance */
    .ftm-dashboard.ftm-loaded .ftm-tables-carousel > .ftm-section,
    .ftm-dashboard.ftm-loaded .ftm-tables-carousel > .ftm-pp-section {
        animation: ftmCarouselSlideIn 0.5s cubic-bezier(.22, 1, .36, 1) both;
    }
    .ftm-dashboard.ftm-loaded .ftm-tables-carousel > :nth-child(1) { animation-delay: .08s; }
    .ftm-dashboard.ftm-loaded .ftm-tables-carousel > :nth-child(2) { animation-delay: .16s; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   TOUCH INTERACTION POLISH
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.ftm-tab-panel.ftm-swiping {
    transition: none !important;
    animation: none !important;
    will-change: transform;
}

@media (max-width: 768px) {
    /* Scroll performance */
    .ftm-summary-card,
    .ftm-info-card,
    .ftm-chart-container,
    .ftm-table-wrap {
        contain: layout style;
    }

    /* Disable hover on touch devices */
    .ftm-summary-card:hover,
    .ftm-info-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Press feedback */
    .ftm-summary-card:active {
        transform: scale(0.97) !important;
        transition: transform 0.1s ease !important;
    }

    .ftm-tab-link:active {
        transform: scale(0.93);
        transition: transform 0.08s ease;
    }

    /* Mobile reduced motion */
    @media (prefers-reduced-motion: reduce) {
        .ftm-tab-panel.active,
        .ftm-tab-panel.ftm-panel-exit,
        .ftm-status-bar,
        .ftm-tab-link.active {
            animation: none !important;
        }
        .ftm-swipe-dot {
            transition: none !important;
        }
    }

    /* Stats strips momentum */
    .ftm-ct-stats-strip,
    .ftm-pp-stats-strip,
    .ftm-chart-controls {
        overscroll-behavior-x: contain;
    }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   LANDSCAPE MOBILE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

@media (max-width: 900px) and (orientation: landscape) {
    .ftm-status-bar {
        flex-direction: row;
        align-items: center;
        padding: 6px 14px;
        position: relative;
        top: auto;
        z-index: 50;
        gap: 8px;
    }

    .ftm-status-hero {
        flex-direction: row;
        gap: 8px;
        flex-shrink: 0;
    }

    .ftm-status-tabs {
        flex: 1;
        justify-content: flex-end;
        width: auto;
        margin: 0;
        padding: 0;
        border-top: none;
    }

    .ftm-tab-link {
        min-height: 34px;
        padding: 4px 10px;
        font-size: 9px;
    }

    .ftm-swipe-indicator { display: none; }

    /* Wider slides in landscape */
    .ftm-summary-card {
        min-width: 45vw;
        max-width: 45vw;
    }

    .ftm-info-card {
        min-width: 55vw;
        max-width: 55vw;
    }

    .ftm-chart-container {
        min-width: 65vw;
        max-width: 65vw;
    }

    .ftm-card-featured { grid-column: span 1 !important; }
}

