/* ============================================================================
   QuantumForge Dashboard V3 - Apple Liquid Glass Design
   Inspired by iOS 26 / Vision Pro aesthetic
   ============================================================================ */

/* =============================================================================
   CSS Variables
   ============================================================================= */
:root {
    /* Base colors - Lighter for glass effect visibility */
    --bg-base: #0D1117;
    --bg-gradient-start: #0a1628;
    --bg-gradient-end: #1a0a28;

    /* Glass properties - Enhanced for liquid glass look */
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-bg-hover: rgba(255, 255, 255, 0.10);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-hover: rgba(255, 255, 255, 0.20);
    --glass-highlight: rgba(255, 255, 255, 0.3);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --glass-blur: 20px;
    --glass-saturate: 180%;

    /* Enhanced edge variables for liquid glass - larger shinier bevels */
    --glass-edge-top: rgba(255, 255, 255, 0.45);
    --glass-edge-left: rgba(255, 255, 255, 0.28);
    --glass-edge-right: rgba(255, 255, 255, 0.06);
    --glass-edge-bottom: rgba(255, 255, 255, 0.02);
    --glass-inner-glow: rgba(255, 255, 255, 0.25);
    --glass-inner-shadow: rgba(0, 0, 0, 0.12);
    --glass-bevel: 3px;

    /* Accent colors - Vibrant */
    --accent-green: #34D399;
    --accent-green-glow: rgba(52, 211, 153, 0.5);
    --accent-cyan: #22D3EE;
    --accent-cyan-glow: rgba(34, 211, 238, 0.5);
    --accent-blue: #60A5FA;
    --accent-blue-glow: rgba(96, 165, 250, 0.5);
    --accent-purple: #A78BFA;
    --accent-purple-glow: rgba(167, 139, 250, 0.5);
    --accent-pink: #F472B6;
    --accent-amber: #FBBF24;
    --accent-red: #F87171;

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 72px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

/* =============================================================================
   Base & Background
   ============================================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    max-width: 100vw;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* =============================================================================
   Animated Gradient Background - The Canvas
   ============================================================================= */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: -10;
    pointer-events: none;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-base) 50%, var(--bg-gradient-end) 100%);
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.7;
    mix-blend-mode: screen;
    animation: float 25s ease-in-out infinite;
}

.orb-1 {
    width: 1200px;
    height: 1200px;
    background: radial-gradient(circle at 40% 40%, var(--accent-cyan) 0%, rgba(34, 211, 238, 0.4) 30%, transparent 70%);
    top: -400px;
    right: -300px;
    animation-delay: 0s;
}

.orb-2 {
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle at 60% 60%, var(--accent-purple) 0%, rgba(167, 139, 250, 0.4) 30%, transparent 70%);
    bottom: -350px;
    left: -200px;
    animation-delay: -12s;
}

/* Third orb for more depth */
.orb-3 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-green) 0%, rgba(52, 211, 153, 0.3) 30%, transparent 70%);
    top: 40%;
    left: 25%;
    animation-delay: -6s;
    opacity: 0.5;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(50px, -60px) scale(1.1) rotate(5deg);
    }
    50% {
        transform: translate(-30px, 40px) scale(0.95) rotate(-3deg);
    }
    75% {
        transform: translate(-50px, -30px) scale(1.05) rotate(3deg);
    }
}

/* =============================================================================
   Liquid Glass Effect - Core Component
   ============================================================================= */
.liquid-glass {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow:
        0 8px 32px var(--glass-shadow),
        inset 0 1px 0 var(--glass-highlight),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.liquid-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.liquid-glass:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px var(--glass-shadow),
        inset 0 1px 0 var(--glass-highlight),
        0 0 40px rgba(34, 211, 238, 0.1);
}

/* =============================================================================
   App Layout
   ============================================================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-collapsed);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Flex items default to min-width:auto and refuse to shrink below their
       intrinsic content width. A wide table / nowrap row inside would then
       push .main-content (and the whole page) wider than the viewport, and
       body{overflow-x:hidden} would simply CLIP the overflow (badges run off
       the right edge). min-width:0 lets this flex item shrink to fit; the
       max-width caps it at the available track and overflow-x:hidden keeps
       any residual wide child from forcing a page-level horizontal scroll. */
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.pinned ~ .main-content,
.app-layout:has(.sidebar.pinned) .main-content {
    margin-left: var(--sidebar-expanded);
}

.dmas-action-bar {
    position: sticky;
    top: var(--header-height);
    margin-top: var(--header-height);
    z-index: 998;
    /* The action bar is display:flex (set inline in app.py) with no wrap.
       Its KILL/FLATTEN/PAUSE buttons + balance + status can exceed the
       available width on narrow/intermediate viewports and overflow the
       right edge. Allow wrapping + a row gap at all widths (the mobile
       media query already wraps; this covers desktop/tablet too). */
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
}

.page-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    /* Same flexbox shrink-refusal fix as .main-content: this is a flex child
       (.main-content is flex-direction:column). Without min-width:0 a wide
       inner block keeps the column from shrinking and the page overflows
       horizontally. overflow-x:hidden contains any residual wide child so it
       does not bleed past the right edge. max-width pins it to the track. */
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* =============================================================================
   Horizontal-overflow guards (badges/chips/grids running off the edge)
   -----------------------------------------------------------------------------
   Robust, non-destructive fixes so wide content shrinks/wraps inside the
   page track instead of forcing the whole layout wider than the viewport.
   ============================================================================= */

/* CSS-grid items with 1fr tracks default to min-width:auto and will expand a
   track past 1fr if their content (esp. white-space:nowrap text) is wider.
   Allow the known wide grids' items to shrink so the grid never overflows. */
.dmas-risk-strip > *,
.dmas-symbol-grid > *,
.dmas-heatmap-grid > *,
#home-risk-strip > *,
#home-symbol-grid > *,
#home-bottom-cards > *,
.metrics-grid > *,
.status-cards-grid > *,
.stat-grid > *,
.results-grid-4 > *,
.replay-metrics > * {
    min-width: 0;
}

/* Badge / chip / pill rows that are flex without wrap can overrun the right
   edge. Let the common badge/chip/strip rows wrap instead of clipping. */
.status-bar,
.trading-controls,
.replay-controls-bar,
.legend-bar {
    flex-wrap: wrap;
}

/* DataTables / wide tables must scroll inside their own wrapper rather than
   widening the page. The wrapper is allowed to scroll; max-width pins it. */
#trade-history,
.trade-log-container,
.dash-table-container,
.dash-spreadsheet-container {
    max-width: 100%;
    overflow-x: auto;
}

/* =============================================================================
   Sidebar - Collapsible Liquid Glass Panel
   ============================================================================= */
:root {
    --sidebar-collapsed: 80px;
    --sidebar-expanded: 280px;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-collapsed);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(40px) saturate(160%) brightness(102%);
    -webkit-backdrop-filter: blur(40px) saturate(160%) brightness(102%);
    /* Gradient border - larger shiny bevel for glass look */
    border-top: 3px solid rgba(255, 255, 255, 0.35);
    border-right: 3px solid rgba(255, 255, 255, 0.06);
    border-bottom: 3px solid rgba(255, 255, 255, 0.02);
    border-left: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 24px 12px;
    /* Enhanced depth with inner glow */
    box-shadow:
        4px 0 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset -1px 0 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Expand on hover OR when pinned */
.sidebar:hover,
.sidebar.pinned {
    width: var(--sidebar-expanded);
    background: rgba(255, 255, 255, 0.03);
    padding: 24px 20px;
}

/* Pin button */
.sidebar-pin {
    position: absolute;
    top: 24px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.sidebar:hover .sidebar-pin,
.sidebar.pinned .sidebar-pin {
    opacity: 1;
}

.sidebar-pin:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.sidebar.pinned .sidebar-pin {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.3);
    color: var(--accent-cyan);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    margin-bottom: 40px;
    white-space: nowrap;
}

.sidebar-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-cyan) 50%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    text-shadow: 0 0 40px var(--accent-cyan-glow);
    transition: font-size 0.3s ease;
}

.sidebar:hover .sidebar-logo-text,
.sidebar.pinned .sidebar-logo-text {
    font-size: 2rem;
}

.sidebar-logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar:hover .sidebar-logo-subtitle,
.sidebar.pinned .sidebar-logo-subtitle {
    opacity: 1;
    width: auto;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    gap: 14px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    justify-content: center;
    white-space: nowrap;
}

.sidebar:hover .sidebar-item,
.sidebar.pinned .sidebar-item {
    justify-content: flex-start;
    padding: 16px 20px;
}

.sidebar-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar:hover .sidebar-item span,
.sidebar.pinned .sidebar-item span {
    opacity: 1;
    width: auto;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-item:hover::before {
    opacity: 1;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(34, 211, 238, 0.1));
    color: var(--accent-green);
    border: 1px solid rgba(52, 211, 153, 0.3);
    box-shadow:
        0 0 20px rgba(52, 211, 153, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

/* Sidebar P&L Section */
.sidebar-pnl-section {
    margin-top: auto;
    padding: 8px;
    transition: padding 0.3s ease;
}

.sidebar:hover .sidebar-pnl-section,
.sidebar.pinned .sidebar-pnl-section {
    padding: 16px;
}

.pnl-sidebar-box {
    position: relative;
    padding: 10px 8px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar:hover .pnl-sidebar-box,
.sidebar.pinned .pnl-sidebar-box {
    padding: 16px;
}

.pnl-sidebar-box.positive {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 211, 238, 0.05));
}

.pnl-sidebar-box.negative {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(251, 146, 60, 0.05));
}

/* Glowing ring effect */
.pnl-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transition: all 0.3s ease;
}

.sidebar:hover .pnl-glow-ring,
.sidebar.pinned .pnl-glow-ring {
    width: 80px;
    height: 80px;
}

.pnl-sidebar-box.positive .pnl-glow-ring {
    background: radial-gradient(circle, rgba(34, 197, 94, 0.3) 0%, transparent 70%);
    animation: pnl-pulse-green 2s ease-in-out infinite;
}

.pnl-sidebar-box.negative .pnl-glow-ring {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, transparent 70%);
    animation: pnl-pulse-red 2s ease-in-out infinite;
}

@keyframes pnl-pulse-green {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}

@keyframes pnl-pulse-red {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}

.pnl-sidebar-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.pnl-sidebar-label {
    font-size: 0.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.15em;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.sidebar:hover .pnl-sidebar-label,
.sidebar.pinned .pnl-sidebar-label {
    font-size: 0.65rem;
    margin-bottom: 4px;
}

.pnl-sidebar-value {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.sidebar:hover .pnl-sidebar-value,
.sidebar.pinned .pnl-sidebar-value {
    font-size: 1.25rem;
    margin-bottom: 2px;
    letter-spacing: 0;
}

.pnl-sidebar-box.positive .pnl-sidebar-value {
    color: #22C55E;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
}

.pnl-sidebar-box.negative .pnl-sidebar-value {
    color: #EF4444;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.pnl-sidebar-pct {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar:hover .pnl-sidebar-pct,
.sidebar.pinned .pnl-sidebar-pct {
    opacity: 1;
    height: auto;
    font-size: 0.8rem;
}

.pnl-sidebar-box.positive .pnl-sidebar-pct {
    color: rgba(34, 197, 94, 0.8);
}

.pnl-sidebar-box.negative .pnl-sidebar-pct {
    color: rgba(239, 68, 68, 0.8);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
}

/* =============================================================================
   Header - Floating Glass Bar
   ============================================================================= */
.header {
    position: fixed;
    top: 16px;
    left: calc(var(--sidebar-collapsed) + 16px);
    right: 16px;
    height: calc(var(--header-height) - 16px);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(103%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(103%);
    /* Gradient border - larger shiny bevel for glass look */
    border-top: 3px solid rgba(255, 255, 255, 0.40);
    border-left: 3px solid rgba(255, 255, 255, 0.25);
    border-right: 3px solid rgba(255, 255, 255, 0.05);
    border-bottom: 3px solid rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    /* Enhanced depth with inner glow */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header shine overlay */
.header::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 40%
    );
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Mobile logo - hidden on desktop */
.header-mobile-logo {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.header-badge:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.header-badge.market-open {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.08);
}

.header-badge.market-closed {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.header-time {
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px 6px 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-user:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    box-shadow: 0 2px 8px var(--accent-green-glow);
}

/* =============================================================================
   Glass Cards - Premium Metric Display
   ============================================================================= */
.glass-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(105%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(105%);
    /* Gradient border - larger shiny bevel for glass look */
    border-top: 3px solid var(--glass-edge-top);
    border-left: 3px solid var(--glass-edge-left);
    border-right: 3px solid var(--glass-edge-right);
    border-bottom: 3px solid var(--glass-edge-bottom);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    /* Enhanced multi-layer shadow for depth */
    box-shadow:
        0 8px 32px var(--glass-shadow),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 var(--glass-inner-glow),
        inset 0 -1px 0 var(--glass-inner-shadow),
        inset 1px 0 0 rgba(255, 255, 255, 0.04),
        inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

/* Shine overlay - gradient sweep */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.04) 30%,
        transparent 60%
    );
    pointer-events: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Liquid shine - corner highlights */
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 35%,
        transparent 65%,
        rgba(255, 255, 255, 0.03) 100%
    );
    box-shadow:
        inset -8px -6px 0px -9px rgba(255, 255, 255, 0.6),
        inset 0px -7px 0px -6px rgba(255, 255, 255, 0.4);
    filter: blur(0.5px);
    pointer-events: none;
    opacity: 0.8;
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    border-top-color: rgba(255, 255, 255, 0.35);
    border-left-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px) scale(1.01);
    box-shadow:
        0 24px 60px var(--glass-shadow),
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 var(--glass-inner-shadow),
        0 0 80px rgba(34, 211, 238, 0.08);
}

.glass-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.glass-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.glass-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.glass-card-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 100px;
    position: relative;
    z-index: 2;
}

.glass-card-change.positive {
    color: var(--accent-green);
    background: rgba(52, 211, 153, 0.1);
}

.glass-card-change.negative {
    color: var(--accent-red);
    background: rgba(248, 113, 113, 0.1);
}

/* =============================================================================
   Metrics Grid
   ============================================================================= */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* =============================================================================
   App Cards - Phone-Style Launcher
   ============================================================================= */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    padding: 24px 0;
}

.app-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(104%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(104%);
    /* Gradient border - larger shiny bevel for glass look */
    border-top: 3px solid var(--glass-edge-top);
    border-left: 3px solid var(--glass-edge-left);
    border-right: 3px solid var(--glass-edge-right);
    border-bottom: 3px solid var(--glass-edge-bottom);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    /* Multi-layer shadows for depth */
    box-shadow:
        0 8px 32px var(--glass-shadow),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 var(--glass-inner-glow),
        inset 0 -1px 0 var(--glass-inner-shadow);
}

/* Shine overlay */
.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.03) 40%,
        transparent 70%
    );
    pointer-events: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Liquid shine corners */
.app-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 30%,
        transparent 70%,
        rgba(255, 255, 255, 0.02) 100%
    );
    box-shadow:
        inset -6px -5px 0px -7px rgba(255, 255, 255, 0.5),
        inset 0px -6px 0px -5px rgba(255, 255, 255, 0.3);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.app-card:hover {
    background: var(--glass-bg-hover);
    border-top-color: rgba(255, 255, 255, 0.35);
    border-left-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 28px 70px var(--glass-shadow),
        0 6px 16px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 var(--glass-inner-shadow),
        0 0 100px rgba(34, 211, 238, 0.12);
}

.app-card:hover::after {
    opacity: 1;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    position: relative;
    z-index: 2;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.app-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 2;
}

.app-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

/* App icon gradients with glow */
.app-icon.green {
    background: linear-gradient(135deg, #34D399, #059669);
    color: white;
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.4), inset 0 2px 0 rgba(255,255,255,0.2);
}
.app-icon.blue {
    background: linear-gradient(135deg, #60A5FA, #2563EB);
    color: white;
    box-shadow: 0 8px 24px rgba(96, 165, 250, 0.4), inset 0 2px 0 rgba(255,255,255,0.2);
}
.app-icon.purple {
    background: linear-gradient(135deg, #A78BFA, #7C3AED);
    color: white;
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.4), inset 0 2px 0 rgba(255,255,255,0.2);
}
.app-icon.cyan {
    background: linear-gradient(135deg, #22D3EE, #0891B2);
    color: white;
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.4), inset 0 2px 0 rgba(255,255,255,0.2);
}
.app-icon.amber {
    background: linear-gradient(135deg, #FBBF24, #D97706);
    color: white;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4), inset 0 2px 0 rgba(255,255,255,0.2);
}
.app-icon.red {
    background: linear-gradient(135deg, #F87171, #DC2626);
    color: white;
    box-shadow: 0 8px 24px rgba(248, 113, 113, 0.4), inset 0 2px 0 rgba(255,255,255,0.2);
}

/* =============================================================================
   Tables - Glass Surface
   ============================================================================= */
.glass-table {
    width: 100%;
    border-collapse: collapse;
}

.glass-table th {
    text-align: left;
    padding: 16px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--glass-border);
}

.glass-table td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.glass-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Trade History Container - Allow horizontal scroll */
#trade-history {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#trade-history .glass-table {
    min-width: 600px;
}

/* =============================================================================
   Terminal Overlay - Floating Glass Panel
   ============================================================================= */
.terminal-overlay {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 750px;
    height: 520px;
    min-width: 400px;
    min-height: 300px;
    max-width: 95vw;
    max-height: 90vh;
    background: rgba(10, 15, 25, 0.85);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 var(--glass-highlight),
        0 0 100px rgba(52, 211, 153, 0.1);
    resize: both;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.terminal-body {
    flex: 1;
    padding: 12px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.terminal-header {
    cursor: move;
    user-select: none;
}

.terminal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.terminal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.terminal-btn-primary {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    border-color: var(--accent-green);
    color: white;
    box-shadow: 0 4px 16px var(--accent-green-glow);
}

.terminal-btn-primary:hover {
    box-shadow: 0 6px 24px var(--accent-green-glow);
    transform: translateY(-1px);
}

.terminal-btn-danger {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--accent-red);
}

.terminal-btn-icon {
    width: 36px;
    padding: 8px;
}

/* Terminal header action buttons (copy, paste, etc.) */
.terminal-header-action {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3B82F6;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.terminal-header-action:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.terminal-header-action:first-of-type {
    margin-left: 16px;
}

/* Floating AI button container */
#ai-floating-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
}

.terminal-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 32px var(--accent-green-glow),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-toggle-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow:
        0 12px 40px var(--accent-green-glow),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

/* =============================================================================
   XTerm Terminal Scrolling Fix
   ============================================================================= */
#terminal-container {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

#terminal-container .xterm {
    height: 100%;
    width: 100%;
}

#terminal-container .xterm-viewport {
    overflow-y: scroll !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.5) transparent;
}

#terminal-container .xterm-viewport::-webkit-scrollbar {
    width: 8px;
}

#terminal-container .xterm-viewport::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#terminal-container .xterm-viewport::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5);
    border-radius: 4px;
}

#terminal-container .xterm-viewport::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.7);
}

/* Ensure xterm screen is scrollable */
#terminal-container .xterm-screen {
    overflow-y: auto;
}

/* Fix for fullscreen terminal overlay */
#ai-terminal-overlay #terminal-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* =============================================================================
   Login Page - Centered Glass Card
   ============================================================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
}

.login-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 var(--glass-highlight);
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
    pointer-events: none;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.login-logo-text {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px var(--accent-cyan-glow);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.login-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 36px;
    position: relative;
    z-index: 2;
}

.login-input,
.login-input input,
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
    width: 100% !important;
    padding: 16px 20px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-primary) !important;
    font-size: 1rem !important;
    margin-bottom: 16px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    z-index: 10 !important;
}

.login-input:focus,
.login-input input:focus,
.login-card input:focus {
    border-color: var(--accent-cyan) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15) !important;
}

.login-input::placeholder,
.login-input input::placeholder,
.login-card input::placeholder {
    color: var(--text-muted) !important;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 24px var(--accent-green-glow);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--accent-green-glow);
}

.login-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--accent-red);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* =============================================================================
   Page Headers
   ============================================================================= */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* =============================================================================
   Responsive Design
   ============================================================================= */
@media (max-width: 1200px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar:hover,
    .sidebar.pinned {
        width: var(--sidebar-expanded);
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    .header {
        left: calc(var(--sidebar-collapsed) + 16px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        left: 16px;
        top: 8px;
        right: 8px;
    }

    .page-content {
        padding: 20px;
    }

    .terminal-overlay {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        height: 50vh;
        bottom: 16px;
    }
}

/* =============================================================================
   Scrollbar - Subtle Glass
   ============================================================================= */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* =============================================================================
   Utility Classes
   ============================================================================= */
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-cyan { color: var(--accent-cyan); }
.text-blue { color: var(--accent-blue); }
.text-purple { color: var(--accent-purple); }
.text-amber { color: var(--accent-amber); }
.text-muted { color: var(--text-muted); }

.glow-green { box-shadow: 0 0 30px var(--accent-green-glow); }
.glow-cyan { box-shadow: 0 0 30px var(--accent-cyan-glow); }
.glow-blue { box-shadow: 0 0 30px var(--accent-blue-glow); }
.glow-purple { box-shadow: 0 0 30px var(--accent-purple-glow); }

/* =============================================================================
   Status Bar - Horizontal Glass Strip
   ============================================================================= */
.status-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.status-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-bar-item .label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.status-bar-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

.status-bar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

/* =============================================================================
   Status Dots - Colored Indicators with Glow
   ============================================================================= */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.status-healthy,
.status-dot.status-success {
    background: #22C55E;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.status-dot.status-warning {
    background: #F59E0B;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.status-dot.status-error,
.status-dot.status-danger {
    background: #EF4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.status-dot.status-neutral {
    background: #6B7280;
    box-shadow: 0 0 8px rgba(107, 114, 128, 0.4);
}

.status-dot.status-pulse {
    background: #06B6D4;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
    animation: pulse-glow-cyan 2s ease-in-out infinite;
}

@keyframes pulse-glow-cyan {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.9);
    }
}

/* =============================================================================
   Progress Bars - Visual Percentage Display
   ============================================================================= */
.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    width: 100%;
}

.progress-bar.progress-lg {
    height: 12px;
    border-radius: 6px;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22C55E, #34D399);
    transition: width 0.3s ease;
}

.progress-fill.progress-cyan {
    background: linear-gradient(90deg, #06B6D4, #22D3EE);
}

.progress-fill.progress-amber {
    background: linear-gradient(90deg, #D97706, #FBBF24);
}

.progress-fill.progress-red {
    background: linear-gradient(90deg, #DC2626, #EF4444);
}

/* =============================================================================
   Stat Grid - Overview Cards
   ============================================================================= */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.stat-card .stat-indicator {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* =============================================================================
   Timeline - Vertical Event List
   ============================================================================= */
.timeline {
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 24px;
    margin-left: 8px;
}

.timeline-item {
    position: relative;
    padding: 16px 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.timeline-item.event-success::before {
    background: #22C55E;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.timeline-item.event-warning::before {
    background: #F59E0B;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.timeline-item.event-error::before {
    background: #EF4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 70px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.timeline-content {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* =============================================================================
   Position Cards - Mini Glass Cards for Positions
   ============================================================================= */
.position-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.position-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.position-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.position-card .position-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.position-card .position-side {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.position-card .position-side.long {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.position-card .position-side.short {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.position-card .position-pnl {
    font-weight: 600;
    font-size: 0.95rem;
}

.position-card .position-pnl.positive {
    color: #22C55E;
}

.position-card .position-pnl.negative {
    color: #EF4444;
}

/* =============================================================================
   Signal Cards - With Confidence Bars
   ============================================================================= */
.signal-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.signal-card {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.signal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.signal-symbol {
    font-weight: 600;
    color: var(--text-primary);
}

.signal-direction {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.signal-direction.long {
    background: rgba(34, 197, 94, 0.15);
    color: #22C55E;
}

.signal-direction.short {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.signal-confidence {
    display: flex;
    align-items: center;
    gap: 10px;
}

.signal-confidence .progress-bar {
    flex: 1;
    height: 6px;
}

.signal-confidence .confidence-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* =============================================================================
   Buttons - Action Styles
   ============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    border-color: var(--accent-green);
    box-shadow: 0 4px 16px var(--accent-green-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-green-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-icon.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* =============================================================================
   Two Column Layout
   ============================================================================= */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .two-column {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================================================
   Chart Container
   ============================================================================= */
.chart-container {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.chart-container .chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-container .chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-container .chart-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-container .chart-change {
    font-size: 0.9rem;
    font-weight: 500;
}

.chart-container .chart-change.positive {
    color: #22C55E;
}

.chart-container .chart-change.negative {
    color: #EF4444;
}

/* =============================================================================
   Section Headers
   ============================================================================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent-cyan);
}

/* =============================================================================
   Glass Input - Search and Text Inputs
   ============================================================================= */
.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.glass-input::placeholder {
    color: var(--text-muted);
}

/* =============================================================================
   Glass Dropdown
   ============================================================================= */
.glass-dropdown {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-sm) !important;
}

.glass-dropdown .Select-control {
    background: transparent !important;
    border: none !important;
}

.glass-dropdown .Select-value-label,
.glass-dropdown .Select-placeholder {
    color: var(--text-secondary) !important;
}

.glass-dropdown .Select-menu-outer {
    background: rgba(20, 25, 35, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-sm) !important;
}

.glass-dropdown .VirtualizedSelectOption {
    color: var(--text-secondary) !important;
}

.glass-dropdown .VirtualizedSelectFocusedOption {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* =============================================================================
   Dark Dropdown (for trade history filters)
   ============================================================================= */
.dark-dropdown {
    background: rgba(20, 25, 35, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
}

.dark-dropdown .Select-control {
    background: rgba(20, 25, 35, 0.95) !important;
    border: none !important;
    cursor: pointer;
}

.dark-dropdown .Select-value-label,
.dark-dropdown .Select-placeholder {
    color: #E2E8F0 !important;
}

.dark-dropdown .Select-arrow {
    border-color: #E2E8F0 transparent transparent !important;
}

.dark-dropdown .Select-menu-outer {
    background: rgba(20, 25, 35, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    margin-top: 4px;
}

.dark-dropdown .VirtualizedSelectOption {
    color: #E2E8F0 !important;
    background: transparent !important;
}

.dark-dropdown .VirtualizedSelectFocusedOption {
    background: rgba(34, 211, 238, 0.2) !important;
    color: #22D3EE !important;
}

/* =============================================================================
   Legend Bar
   ============================================================================= */
.legend-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =============================================================================
   Training Cards - Active Training Progress
   ============================================================================= */
.training-jobs-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.training-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    transition: all 0.2s ease;
}

.training-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.training-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.training-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.training-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    letter-spacing: 0.03em;
}

.training-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.training-progress-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: right;
}

.training-meta {
    display: flex;
    justify-content: space-between;
}

/* Progress bar variations */
.progress-bar.progress-large {
    height: 10px;
    flex: 1;
}

.progress-fill.progress-cyan {
    background: linear-gradient(90deg, #06B6D4, #22D3EE);
}

.progress-fill.progress-purple {
    background: linear-gradient(90deg, #8B5CF6, #A78BFA);
}

/* =============================================================================
   Model Type Badge
   ============================================================================= */
.model-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    letter-spacing: 0.03em;
}

/* =============================================================================
   Model Inventory Table
   ============================================================================= */
.model-inventory-table {
    width: 100%;
}

.model-inventory-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.model-inventory-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.model-inventory-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Status empty dot */
.status-dot.status-empty {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* =============================================================================
   Failed Models Cards
   ============================================================================= */
.failed-models-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.failed-model-card {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    transition: all 0.2s ease;
}

.failed-model-card:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.failed-model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.failed-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.failed-reason {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* =============================================================================
   Service Health Grid
   ============================================================================= */
.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.service-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.service-status-indicator {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(13, 17, 23, 0.8);
}

.service-status-indicator.status-loading {
    background: rgba(255, 255, 255, 0.2);
}

.service-info {
    flex: 1;
}

.service-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.service-tasks {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.service-status-text {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.service-status-text.running,
.service-status-text.active {
    color: #22C55E;
}

.service-status-text.stopped,
.service-status-text.inactive {
    color: #EF4444;
}

.service-status-text.weekend {
    color: #6B7280;
}

/* =============================================================================
   Risk Controls
   ============================================================================= */
.risk-controls-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.risk-control-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.control-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.control-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.control-status {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.control-limit {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 12px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-track {
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    transition: background 0.2s ease;
}

.toggle-track.active {
    background: rgba(239, 68, 68, 0.3);
}

.toggle-thumb {
    position: absolute;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #6B7280;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-thumb.active {
    left: 20px;
    background: #EF4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.loss-limit-bar {
    display: flex;
    align-items: center;
}

.loss-limit-bar .progress-bar {
    flex: 1;
}

/* =============================================================================
   Market Regime Display
   ============================================================================= */
.regime-display {
    text-align: center;
    padding: 20px;
}

.regime-header {
    margin-bottom: 24px;
}

.regime-name {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.regime-params {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.regime-param {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.param-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: lowercase;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.param-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* =============================================================================
   AI Agent Status
   ============================================================================= */
.agent-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.agent-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-sm);
}

.agent-status-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-status-text {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.agent-stat {
    display: flex;
    align-items: baseline;
}

.agent-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.agent-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.agent-section {
    padding: 0 8px;
}

.agent-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.goal-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.goal-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Feedback Buttons */
.feedback-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.goal-item:hover .feedback-buttons {
    opacity: 1;
}

.feedback-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.feedback-btn:hover {
    transform: scale(1.1);
}

.feedback-btn:active {
    transform: scale(0.95);
}

.feedback-btn-good:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22C55E;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.feedback-btn-neutral:hover {
    background: rgba(107, 114, 128, 0.25);
    border-color: rgba(107, 114, 128, 0.5);
    color: #9CA3AF;
    box-shadow: 0 0 8px rgba(107, 114, 128, 0.3);
}

.feedback-btn-bad:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #EF4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

/* =============================================================================
   Events Timeline Enhancements
   ============================================================================= */
.event-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.event-type {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.event-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Progress bar red variant */
.progress-fill.progress-red {
    background: linear-gradient(90deg, #EF4444, #F87171);
}

/* =============================================================================
   Page Header with Action
   ============================================================================= */
.page-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

/* =============================================================================
   Slider Controls
   ============================================================================= */
.slider-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.slider-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 24px;
}

@media (max-width: 1024px) {
    .slider-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .slider-grid-2 {
        grid-template-columns: 1fr;
    }
}

.slider-control {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.dropdown-control {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.slider-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.slider-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.full-width-slider {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 20px;
}

/* Glass Slider Styling */
.glass-slider .rc-slider-rail {
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
}

.glass-slider .rc-slider-track {
    background: linear-gradient(90deg, #06B6D4, #22D3EE);
    height: 6px;
}

.glass-slider .rc-slider-handle {
    background: #fff;
    border: 2px solid #22D3EE;
    width: 18px;
    height: 18px;
    margin-top: -6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.glass-slider .rc-slider-handle:hover,
.glass-slider .rc-slider-handle:focus {
    border-color: #06B6D4;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2);
}

.glass-slider .rc-slider-mark-text {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.confidence-slider .rc-slider-rail {
    height: 10px;
}

.confidence-slider .rc-slider-track {
    height: 10px;
}

.strategy-dropdown {
    min-height: 42px;
}

/* =============================================================================
   Regime Tabs
   ============================================================================= */
.regime-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.regime-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.regime-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.regime-tab.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.regime-params-container {
    padding: 16px 0;
}

.regime-params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

@media (max-width: 768px) {
    .regime-params-grid {
        grid-template-columns: 1fr;
    }
}

.regime-param-control {
    text-align: center;
}

.regime-param-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: lowercase;
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-bottom: 8px;
}

.regime-param-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.regime-slider {
    margin-top: 8px;
}

/* =============================================================================
   Mode Toggle (Live/Replay) - Trading Page
   ============================================================================= */
.trading-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    flex-wrap: wrap;
}

.mode-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 10px;
}

.mode-tab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
    color: #3B82F6;
    background: rgba(59, 130, 246, 0.2);
}

/* Replay Controls */
.replay-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.replay-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.replay-date-picker {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.replay-date-picker input {
    background: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
    padding: 8px 12px !important;
}

.replay-speed-dropdown {
    min-width: 80px;
}

.replay-speed-dropdown .Select-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
}

.replay-strategy-dropdown {
    min-width: 180px;
}

.replay-strategy-dropdown .Select-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
}

/* Replay Progress Bar */
.replay-progress {
    flex: 1;
    min-width: 150px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.replay-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #22D3EE);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.replay-time {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 50px;
}

/* =============================================================================
   Strategy Cockpit - Full Parameter Testing Interface
   ============================================================================= */

.strategy-cockpit {
    padding: 16px 20px;
    overflow: visible;
}

/* Ensure date picker calendar isn't clipped */
.strategy-cockpit .SingleDatePicker,
.strategy-cockpit .SingleDatePickerInput,
.strategy-cockpit .DateInput {
    z-index: 100;
}

.strategy-cockpit .SingleDatePicker_picker {
    z-index: 1000 !important;
    background: rgba(20, 25, 35, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
}

.strategy-cockpit .DayPicker {
    background: transparent !important;
}

.strategy-cockpit .CalendarMonth_caption {
    color: var(--text-primary) !important;
}

.strategy-cockpit .DayPicker_weekHeader_li small {
    color: var(--text-muted) !important;
}

.strategy-cockpit .CalendarDay__default {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-secondary) !important;
}

.strategy-cockpit .CalendarDay__default:hover {
    background: rgba(34, 211, 238, 0.2) !important;
    border-color: rgba(34, 211, 238, 0.5) !important;
}

.strategy-cockpit .CalendarDay__selected {
    background: rgba(34, 211, 238, 0.4) !important;
    border-color: #22D3EE !important;
    color: white !important;
}

.strategy-cockpit .CalendarDay__blocked_out_of_range {
    color: var(--text-muted) !important;
    opacity: 0.3;
}

.strategy-cockpit .DayPickerNavigation_button {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
}

.strategy-cockpit .DayPickerNavigation_svg {
    fill: var(--text-secondary) !important;
}

/* Cockpit Header */
.cockpit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.cockpit-header-left {
    display: flex;
    align-items: center;
}

.cockpit-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.cockpit-preset-dropdown {
    min-width: 140px;
}

.cockpit-preset-dropdown .Select-control,
.cockpit-dropdown .Select-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    min-height: 36px;
}

.cockpit-preset-dropdown .Select-value-label,
.cockpit-preset-dropdown .Select-placeholder,
.cockpit-dropdown .Select-value-label,
.cockpit-dropdown .Select-placeholder {
    color: var(--text-secondary) !important;
}

.cockpit-preset-dropdown .Select-arrow,
.cockpit-dropdown .Select-arrow {
    border-color: var(--text-muted) transparent transparent !important;
}

.cockpit-preset-dropdown .Select-menu-outer,
.cockpit-dropdown .Select-menu-outer {
    background: rgba(20, 25, 35, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    margin-top: 4px;
}

.cockpit-preset-dropdown .VirtualizedSelectOption,
.cockpit-dropdown .VirtualizedSelectOption {
    color: var(--text-secondary) !important;
    padding: 10px 14px !important;
}

.cockpit-preset-dropdown .VirtualizedSelectFocusedOption,
.cockpit-dropdown .VirtualizedSelectFocusedOption {
    background: rgba(34, 211, 238, 0.15) !important;
    color: var(--text-primary) !important;
}

/* Cockpit Top Row */
.cockpit-top-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
    overflow: visible;
}

.cockpit-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: visible;
    position: relative;
}

.cockpit-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.cockpit-date-picker {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
}

/* Dark theme for ALL date picker elements */
.cockpit-date-picker .SingleDatePickerInput,
.cockpit-date-picker .DateInput,
.cockpit-date-picker .DateInput_input {
    background: transparent !important;
    background-color: transparent !important;
}

.cockpit-date-picker input,
.cockpit-date-picker .DateInput_input {
    background: transparent !important;
    background-color: transparent !important;
    color: #22D3EE !important;
    border: none !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
}

.cockpit-date-picker .DateInput_input__focused {
    border-bottom: 2px solid #22D3EE !important;
    background: transparent !important;
}

/* Remove white fang/arrow */
.cockpit-date-picker .DateInput_fang {
    display: none !important;
}

/* Calendar icon button */
.cockpit-date-picker .SingleDatePickerInput_calendarIcon {
    background: transparent !important;
    padding: 8px !important;
}

.cockpit-date-picker .SingleDatePickerInput_calendarIcon svg {
    fill: var(--text-muted) !important;
}

.cockpit-buttons {
    display: flex;
    gap: 8px;
}

.cockpit-btn {
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
}

.cockpit-time {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--accent-cyan);
    padding: 8px 12px;
    background: rgba(34, 211, 238, 0.1);
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
}

/* Cockpit Panels Container */
.cockpit-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    overflow: visible;
}

/* Individual Panel */
.cockpit-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: visible;
}

/* Panel Header */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.panel-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.panel-chevron {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    width: 12px;
}

.panel-chevron.fa-chevron-down {
    transform: rotate(0deg);
}

.panel-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Panel Content */
.panel-content {
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    animation: slideDown 0.2s ease;
    overflow: visible;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Parameter Rows */
.param-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 4px 0;
    overflow: visible;
}

.param-row:last-child {
    margin-bottom: 0;
}

.slider-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    min-width: 110px;
    flex-shrink: 0;
}

.slider-container {
    flex: 1;
    min-width: 120px;
    overflow: visible;
    padding: 6px 8px 6px 0;
}

.toggle-container,
.dropdown-container {
    flex: 1;
    overflow: visible;
}

/* Dash Slider Customization */
.cockpit-slider .rc-slider {
    height: 6px;
}

.cockpit-slider .rc-slider-rail {
    background: rgba(255, 255, 255, 0.1) !important;
    height: 6px !important;
    border-radius: 3px !important;
}

.cockpit-slider .rc-slider-track {
    background: linear-gradient(90deg, #3B82F6, #22D3EE) !important;
    height: 6px !important;
    border-radius: 3px !important;
}

.cockpit-slider .rc-slider-handle {
    background: #fff !important;
    border: 2px solid #22D3EE !important;
    width: 14px !important;
    height: 14px !important;
    margin-top: -4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    opacity: 0.7;
    transition: all 0.2s ease !important;
}

.cockpit-slider .rc-slider-handle:hover,
.cockpit-slider .rc-slider-handle:active,
.cockpit-slider .rc-slider-handle-dragging {
    border-color: #3B82F6 !important;
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.6) !important;
    opacity: 1;
    transform: scale(1.3) !important;
}

.cockpit-slider .rc-slider-mark-text {
    color: var(--text-muted) !important;
    font-size: 0.65rem !important;
}

/* Slider tooltip - override Dash default black box */
.cockpit-slider .rc-slider-tooltip,
.rc-slider-tooltip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    z-index: 1000 !important;
}

.cockpit-slider .rc-slider-tooltip-inner,
.rc-slider-tooltip-inner {
    background: rgba(20, 25, 35, 0.95) !important;
    color: #22D3EE !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(34, 211, 238, 0.3) !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    min-height: auto !important;
}

.cockpit-slider .rc-slider-tooltip-arrow,
.rc-slider-tooltip-arrow {
    border-top-color: rgba(20, 25, 35, 0.95) !important;
}

/* Hide tooltip until hover/drag */
.cockpit-slider .rc-slider-tooltip {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.cockpit-slider:hover .rc-slider-tooltip,
.cockpit-slider .rc-slider-handle-dragging + .rc-slider-tooltip {
    opacity: 1;
}

/* Slider row hover effect - expand slider */
.param-row:hover .cockpit-slider .rc-slider-track {
    height: 8px !important;
}

.param-row:hover .cockpit-slider .rc-slider-rail {
    height: 8px !important;
}

.param-row:hover .cockpit-slider .rc-slider-handle {
    opacity: 1;
}

/* Regime Checklist */
.regime-checklist {
    display: flex;
    gap: 12px;
}

.regime-checklist label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.regime-checklist label:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.regime-checklist input[type="checkbox"] {
    accent-color: #22D3EE;
    width: 14px;
    height: 14px;
}

/* Toggle Radio Buttons */
.toggle-radio {
    display: flex;
    gap: 8px;
}

.toggle-radio label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toggle-radio label:hover {
    background: rgba(255, 255, 255, 0.06);
}

.toggle-radio input[type="radio"] {
    accent-color: #22D3EE;
    width: 14px;
    height: 14px;
}

.toggle-radio input[type="radio"]:checked + span,
.toggle-radio label:has(input:checked) {
    color: #22D3EE;
}

/* Time Dropdown */
.time-dropdown {
    min-width: 90px;
}

/* =============================================================================
   Save Notification
   ============================================================================= */
.save-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =============================================================================
   Settings Tabs
   ============================================================================= */
.settings-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.settings-tab {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}

.settings-tab.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(34, 211, 238, 0.3);
    color: var(--text-primary);
}

.settings-tab.active i {
    color: #22D3EE;
}

/* =============================================================================
   Parameter Knobs
   ============================================================================= */
.param-knobs-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .param-knobs-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .param-knobs-row {
        grid-template-columns: 1fr;
    }
}

.param-knob {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.knob-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.knob-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.knob-slider {
    margin-top: 8px;
}

/* =============================================================================
   Version History
   ============================================================================= */
.version-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.version-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.version-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.version-item.active {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.version-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
}

.version-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 100px;
}

.version-desc {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =============================================================================
   Apps Page V2 - Enhanced App Cards
   ============================================================================= */
.tip-banner {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    margin-bottom: 24px;
}

.apps-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1100px) {
    .apps-grid-v2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .apps-grid-v2 {
        grid-template-columns: 1fr;
    }
}

.app-card-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(var(--glass-blur));
    transition: all 0.25s ease;
    text-decoration: none;
    cursor: pointer;
}

.app-card-v2:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.app-icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.app-card-title-v2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.app-card-desc-v2 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 14px;
    font-weight: 500;
}

.app-card-howto {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    line-height: 1.4;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.app-card-howto span {
    color: rgba(255, 255, 255, 0.65) !important;
    font-size: 0.8rem !important;
}

.app-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-card-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.app-card-status span:last-child {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
}

.settings-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.settings-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* =============================================================================
   Laboratory Page - Two Column Layout
   ============================================================================= */
.lab-two-column {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
}

@media (max-width: 1000px) {
    .lab-two-column {
        grid-template-columns: 1fr;
    }
}

.lab-config-panel {
    height: fit-content;
}

.lab-results-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-row {
    margin-bottom: 16px;
}

.config-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 20px 0;
}

/* Strategy Type Buttons */
.strategy-btn-group {
    display: flex;
    gap: 8px;
}

.strategy-btn {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.strategy-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: #A78BFA;
}

/* Preset Buttons */
.preset-btn-group {
    display: flex;
    gap: 8px;
}

.preset-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-color: var(--glass-border-hover);
}

/* Status Badges */
.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-idle {
    background: rgba(107, 114, 128, 0.15);
    color: #9CA3AF;
}

.status-running {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
    animation: pulse-glow 2s ease-in-out infinite;
}

.status-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22C55E;
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
}

/* Results Grid */
.results-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 800px) {
    .results-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.metric-value-lg {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.winner-banner {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

/* =============================================================================
   Guide Page - Workflow Cards & Tabs
   ============================================================================= */
.guide-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.guide-tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.guide-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.guide-tab.active {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #10B981;
}

.workflow-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 1200px) {
    .workflow-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.workflow-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.workflow-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}

.workflow-card.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

/* =============================================================================
   Glass Input (for number inputs)
   ============================================================================= */
.glass-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.glass-input:focus {
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.06);
}

.glass-input::-webkit-inner-spin-button,
.glass-input::-webkit-outer-spin-button {
    opacity: 0.5;
}

/* Button sizes */
.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 8px;
    min-width: auto;
}

.btn-icon.btn-sm {
    padding: 6px;
}

/* =============================================================================
   Apps Hub - Phone Style Launcher with Liquid Glass Theme
   ============================================================================= */

/* Apps grid - 3x2 layout */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

@media (max-width: 700px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* App launcher card - phone style with glass */
.app-launcher-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.app-launcher-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(165deg, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.app-launcher-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Ghost button for modal */
.btn-ghost {
    background: transparent;
    border: none;
    color: #9CA3AF;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #E5E7EB;
}

/* App Modal - Fullscreen overlay */
.app-modal {
    position: fixed;
    top: 2%;
    left: 2%;
    right: 2%;
    bottom: 2%;
    background: rgba(15, 15, 26, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    z-index: 1001;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.app-modal-tabs {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.app-modal-content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

/* App tabs in modal */
.app-tab {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #9CA3AF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.app-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #E5E7EB;
}

.app-tab.active {
    color: white;
    font-weight: 600;
}

/* Modal content stat cards - darker badges */
.app-modal .stat-card,
.app-modal [class*="stat"] {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Modal section cards - darker background */
.app-modal [style*="backgroundColor: rgba(255,255,255"] {
    background-color: rgba(0, 0, 0, 0.25) !important;
}

/* Dark badges inside modal */
.app-modal .badge,
.app-modal [class*="Badge"] {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Button styles in modal - darker */
.app-modal .btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-modal .btn:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.app-modal .btn-primary,
.app-modal .btn-success {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #10B981 !important;
}

.app-modal .btn-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #EF4444 !important;
}

/* Dark section cards in modal */
.app-modal > div > div {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

/* Terminal tray mode - pulsing glow animation */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(16, 185, 129, 0.8), 0 0 40px rgba(16, 185, 129, 0.4); }
}

/* =============================================================================
   QF Liquid Metal Terminal Button - T-1000 Style
   ============================================================================= */

.qf-terminal-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.qf-terminal-btn:hover {
    transform: scale(1.08);
}

.qf-terminal-btn:hover .qf-liquid-orb {
    box-shadow: 
        0 0 30px rgba(192, 192, 192, 0.6),
        0 0 60px rgba(192, 192, 192, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.4);
}

.qf-liquid-orb {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    /* Liquid metal base - chrome gradient */
    background: linear-gradient(
        145deg,
        #e8e8e8 0%,
        #c0c0c0 20%,
        #a8a8a8 40%,
        #909090 60%,
        #b0b0b0 80%,
        #d0d0d0 100%
    );
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(192, 192, 192, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.8),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.qf-orb-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* Inner liquid mercury pool */
    background: radial-gradient(
        ellipse at 30% 30%,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(200, 200, 200, 0.6) 30%,
        rgba(150, 150, 150, 0.4) 60%,
        transparent 100%
    );
    animation: liquid-morph 4s ease-in-out infinite;
}

.qf-orb-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 255, 255, 0.8) 45%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.8) 55%,
        transparent 60%,
        transparent 100%
    );
    animation: shine-sweep 3s ease-in-out infinite;
}

.qf-orb-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    /* Chrome text effect */
    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #c0c0c0 40%,
        #808080 60%,
        #a0a0a0 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Liquid morphing animation */
@keyframes liquid-morph {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        border-radius: 50%;
    }
    25% {
        transform: translate(-48%, -52%) scale(1.02, 0.98);
        border-radius: 48% 52% 50% 50%;
    }
    50% {
        transform: translate(-50%, -50%) scale(0.98, 1.02);
        border-radius: 50% 50% 48% 52%;
    }
    75% {
        transform: translate(-52%, -48%) scale(1.01, 0.99);
        border-radius: 52% 48% 50% 50%;
    }
}

/* Shine sweep animation */
@keyframes shine-sweep {
    0% {
        transform: translateX(-100%) rotate(25deg);
    }
    100% {
        transform: translateX(100%) rotate(25deg);
    }
}

/* Pulsing state when in tray (connected but hidden) */
.qf-liquid-orb.connected {
    animation: liquid-pulse 2s ease-in-out infinite;
}

@keyframes liquid-pulse {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.4),
            0 0 40px rgba(192, 192, 192, 0.3),
            inset 0 2px 10px rgba(255, 255, 255, 0.8),
            inset 0 -2px 10px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 
            0 4px 30px rgba(0, 0, 0, 0.5),
            0 0 60px rgba(192, 192, 192, 0.5),
            0 0 80px rgba(16, 185, 129, 0.3),
            inset 0 2px 15px rgba(255, 255, 255, 0.9),
            inset 0 -2px 10px rgba(0, 0, 0, 0.2);
    }
}

/* =============================================================================
   Home Page - Quantum Orb & Stats (Liquid Glass Theme)
   ============================================================================= */

/* Quantum Orb Container */
.quantum-orb-container {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer glow ring */
.quantum-orb-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(192, 192, 192, 0.15) 0%,
        rgba(192, 192, 192, 0.05) 50%,
        transparent 70%
    );
    animation: orb-pulse 3s ease-in-out infinite;
}

@keyframes orb-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Main orb core */
.quantum-orb-core {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    /* Liquid glass effect */
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(192, 192, 192, 0.1) 30%,
        rgba(128, 128, 128, 0.05) 70%,
        rgba(64, 64, 64, 0.1) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(192, 192, 192, 0.2),
        inset 0 2px 20px rgba(255, 255, 255, 0.3),
        inset 0 -2px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Shine sweep effect */
.quantum-orb-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 255, 255, 0.4) 45%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.4) 55%,
        transparent 60%,
        transparent 100%
    );
    animation: shine-sweep 4s ease-in-out infinite;
}

/* Stat cards */
.stat-card {
    padding: 20px !important;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #C0C0C0;
    line-height: 1.1;
    /* Chrome text effect */
    background: linear-gradient(180deg, #fff 0%, #c0c0c0 50%, #909090 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-sublabel {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* Hero section enhancement */
.hero-section {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(192, 192, 192, 0.04) 50%,
        rgba(255, 255, 255, 0.06) 100%
    ) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Override stat-value color for specific stats */
.stat-card .stat-value[style*="color: #06B6D4"] {
    background: linear-gradient(180deg, #22D3EE 0%, #06B6D4 50%, #0891B2 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.stat-card .stat-value[style*="color: #8B5CF6"] {
    background: linear-gradient(180deg, #A78BFA 0%, #8B5CF6 50%, #7C3AED 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.stat-card .stat-value[style*="color: #F59E0B"] {
    background: linear-gradient(180deg, #FCD34D 0%, #F59E0B 50%, #D97706 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* =============================================================================
   Trading Page Styles
   ============================================================================= */

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.status-bar-item {
    display: flex;
    align-items: center;
}

.status-bar-item .label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.status-bar-item .value {
    color: #F3F4F6;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-bar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 16px;
}

/* Chart Container - Glass Theme */
.chart-container {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(105%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(105%);
    /* 3px beveled glass borders */
    border-top: 3px solid var(--glass-edge-top);
    border-left: 3px solid var(--glass-edge-left);
    border-right: 3px solid var(--glass-edge-right);
    border-bottom: 3px solid var(--glass-edge-bottom);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    overflow: hidden;
    /* Multi-layer shadow for depth */
    box-shadow:
        0 8px 32px var(--glass-shadow),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 var(--glass-inner-glow),
        inset 0 -1px 0 var(--glass-inner-shadow);
}

/* Shine overlay for chart */
.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.03) 40%,
        transparent 70%
    );
    pointer-events: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 0;
}

.chart-container:hover {
    background: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 12px 40px var(--glass-shadow),
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 var(--glass-inner-shadow);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-title {
    color: #F3F4F6;
    font-weight: 600;
    font-size: 1rem;
}

.chart-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #F3F4F6;
}

.chart-change {
    font-size: 0.9rem;
    margin-left: 8px;
}

.chart-change.positive { color: #22C55E; }
.chart-change.negative { color: #EF4444; }

/* Status Cards Grid - Trading Page Header */
.status-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    width: 100%;
}

@media (max-width: 1200px) {
    .status-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .status-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .status-cards-grid {
        grid-template-columns: 1fr;
    }
}

.status-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(105%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(105%);
    /* 3px beveled glass borders */
    border-top: 3px solid var(--glass-edge-top);
    border-left: 3px solid var(--glass-edge-left);
    border-right: 3px solid var(--glass-edge-right);
    border-bottom: 3px solid var(--glass-edge-bottom);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    /* Multi-layer shadow for depth */
    box-shadow:
        0 8px 32px var(--glass-shadow),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 var(--glass-inner-glow),
        inset 0 -1px 0 var(--glass-inner-shadow);
}

/* Shine overlay */
.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(255, 255, 255, 0.03) 40%,
        transparent 70%
    );
    pointer-events: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.status-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-top-color: rgba(255, 255, 255, 0.35);
    border-left-color: rgba(255, 255, 255, 0.2);
    box-shadow:
        0 12px 40px var(--glass-shadow),
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 var(--glass-inner-shadow);
}

.status-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.status-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #F3F4F6;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.status-card-sub {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title {
    display: flex;
    align-items: center;
    color: #F3F4F6;
}

/* Position Cards */
.position-cards {
    padding: 12px;
}

.position-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.position-card:last-child {
    margin-bottom: 0;
}

.position-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: #F3F4F6;
}

.position-side {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    text-transform: uppercase;
}

.position-side.long {
    background: rgba(34, 197, 94, 0.15);
    color: #22C55E;
}

.position-side.short {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.position-pnl {
    font-weight: 600;
    font-size: 1rem;
}

.position-pnl.positive { color: #22C55E; }
.position-pnl.negative { color: #EF4444; }

/* Signal Cards */
.signal-cards {
    padding: 12px;
}

.signal-card {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.signal-card:last-child {
    margin-bottom: 0;
}

.signal-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.signal-symbol {
    font-weight: 600;
    color: #F3F4F6;
    margin-right: 10px;
}

.signal-direction {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.signal-direction.long {
    background: rgba(34, 197, 94, 0.15);
    color: #22C55E;
}

.signal-direction.short {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.signal-confidence {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22C55E, #34D399);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-fill.progress-red {
    background: linear-gradient(90deg, #EF4444, #F87171);
}

.confidence-value {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    min-width: 40px;
    text-align: right;
}

/* Icon Buttons */
.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: #9CA3AF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #F3F4F6;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}


/* =============================================================================
   MOBILE EXPERIENCE - Apple-Like Polish
   iOS-style bottom navigation, smooth animations, glass effects
   ============================================================================= */

/* Mobile Bottom Navigation Bar - iOS Tab Bar Style */
.mobile-bottom-nav {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: 88px; /* iOS standard + safe area */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 25, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-items {
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 64px;
    padding: 0 16px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 20px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    min-width: 64px;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
}

.mobile-nav-item.active,
.mobile-nav-item:active {
    color: #22D3EE;
    background: rgba(34, 211, 238, 0.1);
}

.mobile-nav-icon {
    font-size: 1.35rem;
    margin-bottom: 4px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-item:active .mobile-nav-icon {
    transform: scale(0.9);
}

.mobile-nav-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Mobile P&L Pill - Floating indicator */
.mobile-pnl-pill {
    position: absolute;
    top: 8px;
    right: 16px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22C55E;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
    animation: pnl-pulse 3s ease-in-out infinite;
}

.mobile-pnl-pill.negative {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #EF4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

@keyframes pnl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.mobile-pnl-text {
    font-family: 'SF Mono', 'Monaco', monospace;
}


/* =============================================================================
   Mobile Media Queries - Comprehensive Responsive Design
   ============================================================================= */

@media (max-width: 768px) {
    /* Show mobile nav, hide desktop sidebar */
    .mobile-bottom-nav {
        display: block;
    }

    .sidebar {
        display: none !important;
    }

    /* Adjust main content for mobile */
    .main-content {
        margin-left: 0 !important;
        padding-bottom: 100px; /* Space for bottom nav */
        max-width: 100vw;
        overflow-x: hidden;
    }

    .page-content {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Mobile header */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 12px 16px;
        background: rgba(10, 15, 25, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 0;
        z-index: 1000;
    }

    .header-left {
        display: none; /* Hide breadcrumbs on mobile */
    }

    /* Show mobile logo on mobile */
    .header-mobile-logo {
        display: flex;
        align-items: center;
    }

    .header-right {
        flex: 1;
        justify-content: flex-end;
        gap: 12px;
    }

    /* Simplify header badges on mobile */
    .header-badge {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .header-time {
        font-size: 0.75rem;
    }

    .header-user span {
        display: none; /* Hide name, keep avatar */
    }

    .header-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Page content adjustments */
    .page-content {
        padding: 80px 16px 24px 16px !important; /* Account for fixed header */
        min-height: calc(100vh - 180px);
    }

    /* Glass cards - full width, tighter spacing */
    .glass-card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 16px;
    }

    /* Hero section on home page */
    .hero-section {
        flex-direction: column !important;
        padding: 20px !important;
        gap: 20px;
        text-align: center;
    }

    .hero-section > div {
        flex: unset !important;
    }

    .hero-section > div:first-child,
    .hero-section > div:last-child {
        text-align: center !important;
    }

    /* Quantum orb - smaller on mobile */
    .quantum-orb-container {
        transform: scale(0.75);
    }

    /* Stat cards - 2 column grid on mobile */
    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .stat-card {
        padding: 16px 12px !important;
    }

    .stat-value {
        font-size: 1.5rem !important;
    }

    .stat-label {
        font-size: 0.7rem !important;
    }

    /* Status cards grid */
    .status-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Tables - horizontal scroll with better touch */
    .glass-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .glass-table::-webkit-scrollbar {
        display: none;
    }

    .glass-table th,
    .glass-table td {
        padding: 12px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Trading page adjustments */
    .intraday-chart {
        height: 250px !important;
    }

    /* Position cards on trading page */
    .positions-section .glass-table {
        font-size: 0.75rem;
    }

    /* Two column to single column */
    .two-column {
        grid-template-columns: 1fr !important;
    }

    /* AI floating button - above mobile nav */
    #ai-floating-button {
        bottom: 100px !important;
        right: 16px !important;
    }

    /* QF orb button - slightly smaller on mobile */
    .qf-liquid-orb {
        width: 52px !important;
        height: 52px !important;
    }

    /* Terminal overlay - mobile optimized */
    .terminal-overlay {
        width: calc(100% - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        height: calc(100vh - 180px) !important;
        bottom: 100px !important;
        top: auto !important;
        border-radius: 20px !important;
        min-width: unset !important;
    }

    .terminal-header {
        padding: 12px 16px !important;
    }

    /* Page titles */
    .page-title {
        font-size: 1.75rem !important;
    }

    .page-subtitle {
        font-size: 0.85rem !important;
    }

    /* Section headers */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Buttons - larger touch targets */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    /* Form inputs - larger touch targets */
    .glass-input,
    .glass-dropdown {
        min-height: 44px;
        font-size: 16px !important; /* Prevents iOS zoom */
    }

    /* Apps grid */
    .apps-grid,
    .app-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Model inventory filters - stack on mobile */
    .section-header > div:last-child {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .section-header .glass-input,
    .section-header .glass-dropdown {
        width: 100% !important;
    }

    /* Failed models cards */
    .failed-model-card {
        padding: 12px;
    }

    /* Training jobs grid */
    .training-jobs-grid {
        gap: 12px;
    }

    .training-card {
        padding: 14px;
    }

    /* Legend bar */
    .legend-bar {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px;
    }

    /* System status third row - stack on mobile */
    .stats-row + div {
        flex-direction: column !important;
    }

    /* Grid layouts - single column on mobile */
    .stat-grid {
        grid-template-columns: 1fr !important;
    }

    .service-grid {
        grid-template-columns: 1fr !important;
    }

    /* DMAS action bar - wrap on mobile */
    .dmas-action-bar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px !important;
    }

    /* ---------------------------------------------------------------
       Home page inline-style overrides (inline styles need !important)
       --------------------------------------------------------------- */

    /* Risk strip: 9-col -> 2-col on mobile */
    #home-risk-strip {
        grid-template-columns: repeat(2, 1fr) !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* P&L chart + Daily Stats: side-by-side -> stacked */
    .home-pnl-row {
        flex-direction: column !important;
    }

    /* Symbol grid: 5-col -> 2-col on mobile */
    #home-symbol-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Bottom cards: 3-col -> 1-col on mobile */
    #home-bottom-cards {
        grid-template-columns: 1fr !important;
    }

    /* Prevent any child from overflowing the viewport */
    .page-content > div {
        max-width: 100% !important;
        overflow-x: hidden;
    }

    /* Risk indicator min-width: allow shrink */
    #home-risk-strip > div {
        min-width: 0 !important;
    }
}

/* Extra small screens (iPhone SE, etc) */
@media (max-width: 375px) {
    .login-card {
        padding: 32px 20px;
    }

    .login-logo-text {
        font-size: 2.5rem;
    }

    .mobile-nav-item {
        padding: 8px 12px;
        min-width: 56px;
    }

    .mobile-nav-icon {
        font-size: 1.2rem;
    }

    .mobile-nav-label {
        font-size: 0.6rem;
    }

    .stats-row {
        grid-template-columns: 1fr !important;
    }

    .status-cards-grid {
        grid-template-columns: 1fr !important;
    }

    .apps-grid,
    .app-cards-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-section {
        padding: 16px !important;
    }

    .quantum-orb-container {
        transform: scale(0.6);
    }

    /* Home page: single column everything on tiny screens */
    #home-risk-strip {
        grid-template-columns: 1fr !important;
    }

    #home-symbol-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Tablet portrait */
@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-bottom-nav {
        display: none;
    }

    .sidebar {
        width: 72px;
    }

    .sidebar:hover {
        width: 240px;
    }

    .main-content {
        margin-left: 72px;
    }

    .stats-row {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}


/* =============================================================================
   Mobile Touch Feedback & Animations
   ============================================================================= */

/* Haptic-like tap feedback */
@media (max-width: 768px) {
    .glass-card,
    .stat-card,
    .app-card,
    .sidebar-item,
    .mobile-nav-item {
        -webkit-tap-highlight-color: transparent;
    }

    .glass-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }

    /* Smooth page transitions */
    .page-content {
        animation: fadeSlideIn 0.3s ease-out;
    }

    @keyframes fadeSlideIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Pull to refresh visual hint */
    .page-content::before {
        content: '';
        position: absolute;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
        opacity: 0;
        transition: opacity 0.2s;
    }
}

/* Safe area padding for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }

    @media (max-width: 768px) {
        .main-content {
            padding-bottom: calc(100px + env(safe-area-inset-bottom));
        }
    }
}

/* Dark mode system preference (already dark, but ensure consistency) */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .gradient-orb {
        animation: none !important;
    }

    .quantum-orb-glow,
    .qf-orb-shine {
        animation: none !important;
    }
}

/* ============================================
   Sortable Table Headers (Jan 8, 2026)
   ============================================ */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, background-color 0.15s ease;
    position: relative;
}

.sortable-header:hover {
    color: #06B6D4 !important;
    background-color: rgba(6, 182, 212, 0.1);
}

.sortable-header:active {
    background-color: rgba(6, 182, 212, 0.2);
}

/* Sort indicator styling */
.sortable-header span:last-child {
    font-size: 0.75rem;
    margin-left: 4px;
}

/* =============================================================================
   Unified Page Tabs - Used across all pages for consistency
   ============================================================================= */
.page-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 24px;
    width: fit-content;
}

.page-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.page-tab.active {
    background: rgba(139, 92, 246, 0.2);
    color: #8B5CF6;
}

.page-tab i {
    font-size: 0.9rem;
}

/* Disabled/Coming Soon tab */
.page-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-tab.disabled:hover {
    background: transparent;
    color: var(--text-muted);
}

/* =============================================================================
   Replay Tab - Controls and Results
   ============================================================================= */
.replay-controls-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.replay-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.replay-control-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.replay-date-picker .SingleDatePickerInput,
.replay-date-picker .DateInput,
.replay-date-picker .DateInput_input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
}

.replay-date-picker .DateInput_input {
    color: #22D3EE !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
}

.replay-speed-select {
    min-width: 100px;
}

.replay-speed-select .Select-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
}

.replay-speed-select .Select-value-label {
    color: var(--text-secondary) !important;
}

.replay-btn-run {
    padding: 10px 24px !important;
    background: linear-gradient(135deg, #8B5CF6, #6366F1) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.replay-btn-run:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.replay-btn-stop {
    padding: 10px 24px !important;
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    border-radius: 8px !important;
    color: #EF4444 !important;
    font-weight: 600 !important;
    cursor: pointer;
}

/* Replay Results Section */
.replay-results {
    padding: 20px;
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 12px;
    margin-top: 20px;
}

.replay-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.replay-simulating {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.replay-simulating-time {
    color: #22D3EE;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.replay-progress-container {
    margin-bottom: 20px;
}

.replay-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.replay-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #22D3EE);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.replay-progress-text {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Replay Metrics Grid */
.replay-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.replay-metric-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-align: center;
}

.replay-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.replay-metric-value.positive { color: #22C55E; }
.replay-metric-value.negative { color: #EF4444; }

.replay-metric-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.replay-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

/* Trade Log */
.trade-log-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.trade-log-header {
    display: grid;
    grid-template-columns: 60px 70px 60px 80px 80px 1fr;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-log {
    max-height: 300px;
    overflow-y: auto;
}

.trade-log-row {
    display: grid;
    grid-template-columns: 60px 70px 60px 80px 80px 1fr;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: background 0.15s ease;
}

.trade-log-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.trade-log-row.positive .trade-pnl { color: #22C55E; }
.trade-log-row.negative .trade-pnl { color: #EF4444; }

.trade-time {
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text-muted);
}

.trade-symbol {
    font-weight: 600;
    color: var(--text-primary);
}

.trade-side {
    font-weight: 500;
}

.trade-side.long { color: #22C55E; }
.trade-side.short { color: #EF4444; }

.trade-exit {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-muted);
}

/* Empty state */
.replay-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.replay-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .replay-metrics {
        grid-template-columns: 1fr;
    }

    .trade-log-header,
    .trade-log-row {
        grid-template-columns: 50px 60px 50px 70px 1fr;
    }

    .trade-log-header > *:nth-child(5),
    .trade-log-row > *:nth-child(5) {
        display: none;
    }
}

/* =============================================================================
   DMAS Dashboard Layouts (Phase 9)
   ============================================================================= */

/* Risk strip — 8 columns, responsive */
.dmas-risk-strip {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

/* Symbol grid — 5 columns for 20 symbols */
.dmas-symbol-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

/* Inventory heatmap — same as symbol grid */
.dmas-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

/* Action bar — sticky top bar */
.dmas-action-bar {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* EOD progress bar steps */
.eod-progress-bar {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Compact all-20 quote table */
.quote-table-compact {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.quote-table-compact th {
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
}
.quote-table-compact td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #ddd;
}
.quote-table-compact tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* Symbol cell direction borders */
.symbol-cell.long { border-left: 3px solid #10B981; }
.symbol-cell.short { border-left: 3px solid #EF4444; }
.symbol-cell.flat { border-left: 3px solid #333; }

/* Inventory bar */
.inventory-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.inventory-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.inventory-bar-fill.long { background: #10B981; }
.inventory-bar-fill.short { background: #EF4444; }

/* Tablet: 1200px */
@media (max-width: 1200px) {
    .dmas-risk-strip {
        grid-template-columns: repeat(4, 1fr);
    }
    .dmas-symbol-grid,
    .dmas-heatmap-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile: 768px */
@media (max-width: 768px) {
    .dmas-risk-strip {
        grid-template-columns: repeat(2, 1fr);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }
    .dmas-risk-strip > * {
        scroll-snap-align: start;
    }
    .dmas-symbol-grid,
    .dmas-heatmap-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small mobile: 480px */
@media (max-width: 480px) {
    .dmas-risk-strip {
        grid-template-columns: repeat(2, 1fr);
    }
    .dmas-risk-strip > * {
        min-width: 45%;
    }
    .dmas-symbol-grid,
    .dmas-heatmap-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   PHX Lab - Custom Slider Styles (glass/purple theme)
   ============================================================================= */

.phx-slider .rc-slider-rail {
    background: rgba(139, 92, 246, 0.12) !important;
    height: 6px !important;
    border-radius: 3px !important;
}

.phx-slider .rc-slider-track {
    background: linear-gradient(90deg, #8B5CF6, #A78BFA) !important;
    height: 6px !important;
    border-radius: 3px !important;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.phx-slider .rc-slider-handle {
    width: 18px !important;
    height: 18px !important;
    margin-top: -6px !important;
    background: radial-gradient(circle at 40% 35%, #C4B5FD, #8B5CF6) !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    opacity: 1 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.phx-slider .rc-slider-handle:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.phx-slider .rc-slider-handle:active {
    transform: scale(1.1) !important;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.8) !important;
}

.phx-slider .rc-slider-mark-text {
    color: #4B5563 !important;
    font-size: 0.65rem !important;
}

.phx-slider .rc-slider-tooltip-inner {
    background: rgba(139, 92, 246, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 2px 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.phx-slider .rc-slider-tooltip-arrow {
    border-top-color: rgba(139, 92, 246, 0.9) !important;
}

/* PHX Lab date dropdown dark theme override */
.phx-slider .rc-slider-dot {
    display: none !important;
}

/* PHX Lab - Info Tooltip (hover to reveal) */
.phx-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.phx-tooltip-text {
    display: none;
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(30, 20, 60, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    color: #D1D5DB;
    font-size: 0.75rem;
    line-height: 1.5;
    width: 260px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5),
                0 0 15px rgba(139, 92, 246, 0.15);
    pointer-events: none;
    font-weight: 400;
}

.phx-tooltip-wrap:hover .phx-tooltip-text {
    display: block;
}

/* PHX Lab - Quick Select Date Buttons */
.phx-quick-btn {
    font-size: 0.68rem;
    padding: 3px 10px;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(59, 130, 246, 0.1);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-weight: 600;
    transition: all 0.15s ease;
}

.phx-quick-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}
