:root {
    /* Brand & Accent Tokens - Quant Indigo */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    /* Prestige Quant Gold (Hermetic Institutional Accent) */
    --gold: #d4a853;
    --gold-light: #f3d489;
    --gold-dark: #b8860b;
    --gold-glow: rgba(212, 168, 83, 0.25);
    
    /* Semantic Status Tokens */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --danger: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.12);

    /* Background Hierarchy - Deep Institutional Slate */
    --bg-primary: #090d16;
    --bg-secondary: #0f1626;
    --bg-tertiary: #17223b;
    --bg-card: rgba(15, 22, 38, 0.85);
    --bg-card-hover: rgba(19, 28, 48, 0.92);
    
    /* High-Precision Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-hover: rgba(99, 102, 241, 0.4);
    --border-gold: rgba(212, 168, 83, 0.35);
    
    /* Text Hierarchy - WCAG AA compliant against #090d16 (ratio >= 4.5:1) */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #8292ab;
    
    /* Typography - Clean Institutional Hierarchy */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Elevation & Shadows */
    --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --card-shadow-hover: 0 8px 30px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.35);
}

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

/* Fluid Text Contention & Wrap Adaptability */
p, h1, h2, h3, h4, h5, h6, span, label, td, th, div {
    overflow-wrap: break-word;
}

/* Ensure flex & grid children do not overflow parent boundaries */
.main-wrapper,
.content-area,
.view-header,
.card,
.stat-card,
.stat-content,
.split-view-container,
.split-view-container > div,
.chart-container,
.tracked-markets-card,
.operation-card,
.goal-card,
.achievement-card,
.adm-modal-card,
.modal-card,
.table-card,
.modal-content,
.modal-checkout-content {
    min-width: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.25;
}

/* Institutional Quant Grid Background */
.sacred-geometry {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 85% 85%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

.circle {
    display: none;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: 250px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 20px 18px 20px;
    border-bottom: 1px solid var(--border);
}

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

.brand-logo, .eye-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.logo h1 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.nav-links {
    list-style: none;
    padding: 12px 10px;
    flex: 1;
    overflow-y: auto;
}

.nav-section-header {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 12px 14px 4px 14px;
    user-select: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    margin-bottom: 3px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0;
    border-radius: 8px;
    border-left: 3px solid transparent;
}

.nav-item .icon {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.nav-item .icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
}

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

.nav-item:hover .icon {
    color: var(--primary-light);
}

.nav-item.active {
    color: #60a5fa;
    background-color: rgba(59, 130, 246, 0.12);
    border-left: 3px solid var(--primary);
    font-weight: 600;
    text-shadow: none;
}

.nav-item.active .icon {
    color: #60a5fa;
}

.sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
}

.user-tier {
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.08);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.08em;
}

.quote {
    font-family: var(--font-body);
    font-style: normal;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

.top-header {
    min-height: 60px;
    height: auto;
    border-bottom: 1px solid var(--border);
    background-color: rgba(15, 22, 38, 0.88);
    backdrop-filter: blur(14px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 5;
}

.header-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.clock {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    line-height: 1.25;
}

/* Header Live Connection Badge */
.connection-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    line-height: 1.25;
}

.status-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.badge-live {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}
.badge-live .status-indicator-dot {
    background-color: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.badge-connecting {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}
.badge-connecting .status-indicator-dot {
    background-color: var(--warning);
    animation: pulse-dot 1.2s infinite ease-in-out;
}

.badge-offline {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}
.badge-offline .status-indicator-dot {
    background-color: var(--danger);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.btn-reconnect-badge {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
}
.btn-reconnect-badge:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

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

/* Institutional Legal Footer */
.app-legal-footer {
    padding: 10px 24px;
    border-top: 1px solid var(--border);
    background: rgba(9, 13, 22, 0.92);
    backdrop-filter: blur(10px);
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.legal-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.legal-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.legal-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.legal-sep {
    color: var(--border);
}

/* Focus Visibility & Accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.content-area {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary); 
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15); 
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28); 
}

/* Views & Cards */
.view-header {
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.view-header h2 {
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.25;
    overflow-wrap: break-word;
}

.view-header p {
    color: var(--text-secondary);
    font-size: clamp(0.82rem, 1.2vw, 0.92rem);
    line-height: 1.45;
    max-width: 900px;
    overflow-wrap: break-word;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: clamp(16px, 2vw, 24px);
    backdrop-filter: blur(14px);
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    margin-bottom: 22px;
    height: auto;
    min-height: fit-content;
    min-width: 0;
    word-break: normal;
}

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

.card h3 {
    margin-bottom: 18px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    overflow-wrap: break-word;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: clamp(14px, 1.8vw, 22px);
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100%;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    min-width: 0;
    height: auto;
    min-height: fit-content;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--card-shadow-hover);
}

.stat-content {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.stat-icon {
    font-size: 1.35rem;
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.12);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-label {
    font-size: clamp(0.68rem, 0.9vw, 0.74rem);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    line-height: 1.25;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
}

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

/* Charts */
.charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
    height: 360px;
}

.chart-container {
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* Canvas wrapper — Chart.js needs the canvas parent to have a defined size */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: calc(100% - 40px); /* Subtract header height roughly */
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Language Selector */
.lang-selector {
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 7px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s ease;
}

.lang-selector:hover {
    border-color: var(--border-hover);
}

.lang-selector option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Performance chart card (flex:2) — line chart gets more horizontal space */
.charts-row > .chart-container:first-child {
    min-width: 0;
    flex: 2 1 0%;
}

/* Distribution chart card (flex:1) — donut with legend below */
.charts-row > .chart-container:last-child {
    min-width: 220px;
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.88rem;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.data-table.selectable tbody tr {
    cursor: pointer;
}

.data-table.selectable tbody tr.active {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary);
}

/* Verdict Colors */
.verdict-strong-buy { color: #38bdf8; font-weight: 600; }
.verdict-buy { color: var(--success); font-weight: 600; }
.verdict-observe { color: var(--text-secondary); font-weight: 500; }
.verdict-ignore { color: var(--text-muted); opacity: 0.75; }

/* ==========================================================================
   UNIFIED INSTITUTIONAL BUTTON SYSTEM (GOLD & QUANT INDIGO)
   ========================================================================== */

/* Universal Button Base Reset & Micro-Interactions */
button, .btn {
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    line-height: 1.35;
    border-radius: 8px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-sizing: border-box;
    text-decoration: none;
    text-align: center;
    border: 1px solid transparent;
    outline: none;
    white-space: normal;
    -webkit-tap-highlight-color: transparent;
}

button:disabled, .btn:disabled, .btn.disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

button:hover, .btn:hover {
    transform: translateY(-1.5px);
}

button:active, .btn:active {
    transform: translateY(0.5px) scale(0.985);
}

button:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* 1. Primary Action: Hermetic Prestige Gold Gradient */
.btn-primary {
    background: linear-gradient(135deg, #e5b85c 0%, #d4a853 50%, #b8860b 100%);
    color: #080c14;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 14px -1px rgba(212, 168, 83, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f3d489 0%, #deb35f 50%, #c59316 100%);
    box-shadow: 0 6px 20px 0 rgba(212, 168, 83, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    color: #04060b;
}

.btn-primary:active {
    background: linear-gradient(135deg, #c59316 0%, #b8860b 100%);
    box-shadow: 0 2px 6px rgba(212, 168, 83, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: translateY(0.5px) scale(0.985);
}

/* 2. Secondary Action: Deep Quant Indigo Glassmorphism */
.btn-secondary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(79, 70, 229, 0.24) 100%);
    color: #e0e7ff;
    font-weight: 600;
    border: 1px solid rgba(129, 140, 248, 0.35);
    box-shadow: 0 3px 12px -2px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.28) 0%, rgba(79, 70, 229, 0.38) 100%);
    color: #ffffff;
    border-color: rgba(165, 180, 252, 0.6);
    box-shadow: 0 6px 18px -2px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-secondary:active {
    background: rgba(79, 70, 229, 0.32);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(0.5px) scale(0.985);
}

/* 3. Ghost / Subtle Action: Frosted Obsidian Glass */
.btn-ghost {
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 168, 83, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(212, 168, 83, 0.18);
    transform: translateY(-1.5px);
}

.btn-ghost:active, .btn-ghost.active {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.18), rgba(99, 102, 241, 0.18));
    color: var(--gold-light);
    border-color: var(--gold);
    box-shadow: 0 0 14px rgba(212, 168, 83, 0.25);
}

/* 4. Button Sizes */
.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
    border-radius: 6px;
    gap: 6px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 0.98rem;
    border-radius: 10px;
    font-weight: 700;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 0.72rem;
    border-radius: 4px;
    gap: 4px;
}

/* 5. Universal Modal Close Button */
.modal-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.modal-close:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
    transform: scale(1.06);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.modal-close:active {
    transform: scale(0.95);
}

/* 6. Semantic Human-In-The-Loop Execution Buttons */
.btn-hitl-paper, .btn-hitl-demo {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

.btn-hitl-paper:hover, .btn-hitl-demo:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
    transform: translateY(-2px) !important;
}

.btn-hitl-live {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border: 1px solid rgba(254, 202, 202, 0.35) !important;
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    animation: pulseRed 2s infinite !important;
}

.btn-hitl-live:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%) !important;
    box-shadow: 0 6px 26px rgba(239, 68, 68, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* 7. Dedicated Space & Filter Buttons */
.trading-spaces-filter {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 4px;
}

.btn-space-filter {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-space-filter.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-reset-danger {
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.btn-reset-danger:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.55) !important;
    color: #fecaca !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3) !important;
}

/* 8. Broker Selection Tabs & Space Cards */
.broker-tab-btn {
    padding: 6px 14px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.broker-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.broker-tab-btn.active {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.18), rgba(99, 102, 241, 0.12));
    border-color: var(--gold);
    color: var(--gold-light);
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.25);
}

.mode-space-card {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
}

.mode-space-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(20, 30, 55, 0.8);
}

.mode-space-card.active#btn-mode-paper,
.mode-space-card.active.mode-paper {
    border-color: rgba(34, 197, 94, 0.5) !important;
    background: rgba(34, 197, 94, 0.12) !important;
    color: #4ade80 !important;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.2) !important;
}

.mode-space-card.active#btn-mode-demo,
.mode-space-card.active.mode-demo {
    border-color: rgba(245, 158, 11, 0.5) !important;
    background: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.2) !important;
}

.mode-space-card.active#btn-mode-live,
.mode-space-card.active.mode-live {
    border-color: rgba(239, 68, 68, 0.5) !important;
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.25) !important;
}

/* 9. Admin Dialog Tabs */
.adm-modal-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.adm-modal-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.adm-modal-tab:hover {
    color: var(--text-primary);
    border-color: rgba(212, 168, 83, 0.3);
    background: rgba(212, 168, 83, 0.05);
}

.adm-modal-tab.active {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.15), rgba(99, 102, 241, 0.15));
    border-color: var(--gold);
    color: var(--gold-light);
    box-shadow: 0 0 10px rgba(212, 168, 83, 0.2);
}

input[type="text"], input[type="password"], input[type="number"], select {
    background: rgba(15, 22, 38, 0.9);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 9px 14px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Ticker */
.ticker-bar {
    height: 38px;
    background-color: rgba(15, 22, 38, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    border-top: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.ticker-content {
    display: flex;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-item {
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border);
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Components */
.filters-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.markets-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
}

.markets-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.markets-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.indicators-panel {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Ouroboros Loading */
.oracle-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.ouroboros {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-top-color: var(--gold);
    border-right-color: var(--primary);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin-bottom: 16px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--gold);
}

.ouroboros.large {
    width: 80px;
    height: 80px;
    border-width: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.coming-soon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    text-align: center;
}

.hidden { display: none !important; }

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 60px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 4px;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Chat UI */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    position: relative;
    overflow: hidden;
}

.chat-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 10px;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.user-badge-icon {
    font-size: 1rem;
}

.user-name-highlight {
    color: var(--gold);
    font-family: var(--font-mono, monospace);
    background: rgba(212, 168, 83, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(212, 168, 83, 0.25);
}

.chat-system-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.db-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.db-status-pill code {
    color: #4ade80;
    font-weight: 600;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: pulseGlow 1.8s infinite ease-in-out;
}

.context-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    font-size: 0.78rem;
}

.context-pill .sync-icon {
    color: var(--gold);
    animation: pulseGlow 2s infinite ease-in-out;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 82%;
    animation: fadeInMsg 0.25s ease forwards;
}

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

.system-msg {
    align-self: flex-start;
}

.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.system-msg .icon {
    color: var(--gold);
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.user-msg .icon {
    color: var(--primary);
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.msg-content {
    background: var(--bg-tertiary);
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    line-height: 1.6;
    color: var(--text-primary);
    word-break: break-word;
}

.user-msg .msg-content {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
}

/* Oracle Loading Mystical Indicator */
.oracle-loading-container {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(212, 168, 83, 0.3);
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(212, 168, 83, 0.15);
}

.oracle-pulsing-glyph {
    color: var(--gold);
    font-size: 1.6rem;
    display: inline-block;
    animation: mysticalPulse 2s infinite ease-in-out;
    text-shadow: 0 0 12px rgba(212, 168, 83, 0.8);
}

.loading-text-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.loading-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--gold);
    box-shadow: 0 0 6px var(--gold);
    display: inline-block;
    animation: dotBlink 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes mysticalPulse {
    0% { transform: scale(1) rotate(0deg); opacity: 0.7; filter: drop-shadow(0 0 4px rgba(212, 168, 83, 0.4)); }
    50% { transform: scale(1.25) rotate(15deg); opacity: 1; filter: drop-shadow(0 0 16px rgba(212, 168, 83, 0.9)); }
    100% { transform: scale(1) rotate(0deg); opacity: 0.7; filter: drop-shadow(0 0 4px rgba(212, 168, 83, 0.4)); }
}

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

@keyframes dotBlink {
    0%, 80%, 100% { transform: scale(0); opacity: 0.2; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: rgba(10, 14, 26, 0.6);
}

.chat-input-area input {
    flex: 1;
}

/* ==========================================================================
   ALMANAC, OBSIDIAN KNOWLEDGE VAULT & D3 GRAPH
   ========================================================================== */

.almanac-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.15), rgba(99, 102, 241, 0.15));
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.2);
}

/* D3 Graph Layout */
.graph-layout {
    position: relative;
    padding: 0;
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.graph-header {
    padding: 14px 20px;
    background: rgba(17, 24, 39, 0.95);
    border-bottom: 1px solid var(--border);
    z-index: 5;
}

.graph-legend {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-user { background: #6366f1; box-shadow: 0 0 6px #6366f1; }
.dot-asset { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.dot-account { background: #10b981; box-shadow: 0 0 6px #10b981; }
.dot-goal { background: #ec4899; box-shadow: 0 0 6px #ec4899; }
.dot-risk { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

.graph-svg-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.04) 0%, rgba(10, 14, 26, 0.9) 100%);
    cursor: grab;
}

.graph-svg-wrapper:active {
    cursor: grabbing;
}

#almanac-d3-graph {
    width: 100%;
    height: 100%;
}

.graph-node-details {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 168, 83, 0.15);
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

/* Virtual Obsidian Markdown Vault Layout */
.vault-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    height: 600px;
}

.vault-sidebar {
    overflow-y: auto;
    padding: 16px;
}

.vault-sidebar h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--gold);
}

.vault-file-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vault-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.vault-file-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.3);
}

.vault-file-item.active {
    background: rgba(212, 168, 83, 0.1);
    color: var(--gold);
    border-color: rgba(212, 168, 83, 0.4);
    font-weight: 500;
}

.vault-main {
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

.vault-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.vault-markdown-content {
    line-height: 1.7;
    color: var(--text-primary);
    font-size: 0.92rem;
}

/* Obsidian Frontmatter */
.obsidian-frontmatter {
    background: rgba(10, 14, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.frontmatter-title {
    color: var(--gold);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    font-weight: bold;
}

.frontmatter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.frontmatter-row code {
    color: #818cf8;
}

/* Obsidian Callouts */
.obsidian-callout {
    border-left: 4px solid var(--gold);
    background: rgba(212, 168, 83, 0.05);
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    margin: 16px 0;
}

.callout-title {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    color: var(--gold);
}

.callout-body {
    font-size: 0.88rem;
    color: #cbd5e1;
}

.callout-tip {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
}
.callout-tip .callout-title { color: #818cf8; }

.callout-important {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}
.callout-important .callout-title { color: #fbbf24; }

.callout-success {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.06);
}
.callout-success .callout-title { color: #4ade80; }

.callout-warning {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}
.callout-warning .callout-title { color: #f87171; }

.obsidian-wikilink {
    color: var(--gold);
    background: rgba(212, 168, 83, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border-bottom: 1px dashed var(--gold);
    cursor: default;
}

/* ==========================================================================
   REAL-TIME OPERATIONS & CONFIRMATION CARDS
   ========================================================================== */

.operation-card {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.08), rgba(17, 24, 39, 0.95));
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 16px;
    margin: 10px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 168, 83, 0.1);
}

.op-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.op-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid;
    text-transform: uppercase;
}

.op-id {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.op-status-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--gold);
    animation: mysticalPulse 2s infinite ease-in-out;
}

.op-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    background: rgba(10, 14, 26, 0.6);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.op-label {
    color: var(--text-muted);
}

.op-notes {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-bottom: 14px;
    padding-left: 8px;
    border-left: 2px solid rgba(212, 168, 83, 0.3);
}

.op-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-op-confirm {
    background: linear-gradient(135deg, #d4a853, #b8860b) !important;
    color: #0a0e1a !important;
    font-weight: 600 !important;
    box-shadow: 0 0 10px rgba(212, 168, 83, 0.3) !important;
}

.btn-op-cancel {
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.btn-op-cancel:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.op-success-banner {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
}

.op-cancelled-banner {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
}

/* ==========================================================================
   GOALS & ACHIEVEMENTS
   ========================================================================== */

.goals-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

.goals-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.2s;
}

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

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.08);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #6366f1, #d4a853);
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.achievements-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.achievement-card:hover {
    border-color: rgba(212, 168, 83, 0.4);
    background: rgba(212, 168, 83, 0.04);
}

.ach-badge-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.4));
}

.ach-info strong {
    color: var(--gold);
    display: block;
    margin-bottom: 2px;
}

.ach-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

.ach-info small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==========================================================================
   MODALS & EXECUTIVE REPORT VIEWER
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    width: 480px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-gold);
    background: var(--bg-secondary);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(212, 168, 83, 0.2);
}

.report-modal-card {
    width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.report-frame-container {
    flex: 1;
    width: 100%;
    height: 100%;
    margin-top: 14px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.report-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #0a0e1a;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* ==========================================================================
   ADMIN & CUSTOMER SUPERVISION SANCTUM
   ========================================================================== */

.hidden {
    display: none !important;
}

/* Operator Header Badge */
.header-operator-pill {
    display: flex;
    align-items: center;
    gap: 12px;
}

.operator-badge-root {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.25), rgba(212, 168, 83, 0.08));
    color: var(--gold-light);
    border: 1px solid var(--border-gold);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: 0 0 14px rgba(212, 168, 83, 0.2);
    text-transform: uppercase;
}

/* Role Badges */
.role-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.04em;
}

.badge-root {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.25), rgba(212, 168, 83, 0.08)) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(212, 168, 83, 0.5) !important;
    box-shadow: 0 0 10px rgba(212, 168, 83, 0.25) !important;
}

.badge-admin {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(168, 85, 247, 0.08)) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.25) !important;
}

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

/* Status Pills */
.status-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    display: inline-block;
    letter-spacing: 0.02em;
}

.status-pill.active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pill.suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 4px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.7); }
}

/* Admin Controls Bar */
.adm-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.adm-search-wrap {
    display: flex;
    align-items: center;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    flex: 1;
    min-width: 280px;
    gap: 10px;
    transition: border-color 0.2s;
}

.adm-search-wrap:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.2);
}

.adm-search-wrap input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-size: 13px;
}

.adm-filters-wrap {
    display: flex;
    gap: 10px;
}

.adm-select {
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.adm-select:focus {
    border-color: var(--gold);
}

/* Admin Users Table */
.adm-table-card {
    padding: 0;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
}

.adm-table th {
    background: rgba(10, 14, 26, 0.9);
    padding: 14px 18px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.adm-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    vertical-align: middle;
}

.adm-user-row {
    transition: background 0.15s ease;
}

.adm-user-row:hover {
    background: rgba(99, 102, 241, 0.05);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-mini {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #92400e);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.user-name-bold {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.user-subtext {
    font-size: 11px;
    color: var(--text-muted);
}

.user-email {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Action Buttons */
.action-buttons-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.btn-action-supervise {
    background: rgba(212, 168, 83, 0.15);
    color: var(--gold-light);
    border: 1px solid rgba(212, 168, 83, 0.35);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-action-supervise:hover {
    background: rgba(212, 168, 83, 0.3);
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.35);
    transform: translateY(-1px);
}

.btn-action-key {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-action-key:hover {
    background: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.btn-action-toggle {
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-action-toggle.btn-warn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-action-toggle.btn-warn:hover {
    background: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.btn-action-toggle.btn-ok {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.btn-action-toggle.btn-ok:hover {
    background: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

/* Modal Dialog: Deep Supervision Console */
.adm-modal-card {
    width: 980px;
    max-width: 96vw;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-gold);
    border-radius: 14px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(212, 168, 83, 0.18);
    padding: 24px;
}

.adm-modal-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    margin: 18px 0 22px;
    overflow-x: auto;
}

.adm-modal-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.adm-modal-tab:hover {
    color: var(--text-primary);
}

.adm-modal-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    text-shadow: 0 0 10px rgba(212, 168, 83, 0.4);
}

.adm-tab-panel {
    display: none;
}

.adm-tab-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

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

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

.adm-panel-box {
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
}

.adm-mini-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.adm-mini-card {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mini-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Pending Trade Cards */
.pending-trade-card {
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pending-trade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 168, 83, 0.15);
}

.trade-action-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
}

.trade-action-badge.BUY {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.trade-action-badge.SELL {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.trade-asset-title {
    font-weight: 700;
    color: var(--gold-light);
    margin: 0 8px;
}

.trade-qty {
    font-size: 12px;
    color: var(--text-secondary);
}

.trade-total-badge {
    font-weight: 700;
    color: var(--gold);
    font-size: 15px;
    font-family: var(--font-mono);
}

.asset-type-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.goal-item-card {
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.relation-item-pill {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 12px;
}

.relation-item-pill .rel-cat {
    color: var(--gold);
    font-weight: 600;
    font-size: 11px;
    margin-right: 6px;
}

.empty-notice {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(10, 14, 26, 0.4);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

/* Refresh rotation keyframe */
.rotating {
    animation: spin-refresh 0.6s linear infinite;
}

@keyframes spin-refresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


/* =====================================================
   MULTIMODAL CHAT — File Upload & Drag/Drop Styles
   ===================================================== */

/* Chat Input Row with Attach Button */
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chat-input-row #chat-input {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 140px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s, height 0.1s;
    overflow-y: auto;
    box-sizing: border-box;
}

.chat-input-row #chat-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.2);
}

/* Attach Button */
.btn-attach {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.3);
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-attach:hover {
    background: rgba(212, 168, 83, 0.25);
    border-color: var(--gold);
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.2);
}

.btn-attach svg {
    width: 18px;
    height: 18px;
}

/* File Preview Bar */
.chat-file-preview {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    animation: fadeSlideUp 0.3s ease;
}

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

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 180px;
    max-width: 300px;
}

.file-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.2);
    flex-shrink: 0;
}

.file-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon-large {
    font-size: 20px;
}

.file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 10px;
    color: var(--text-muted);
}

.file-remove {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

/* Drag & Drop Overlay */
.chat-drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(4px);
    border: 3px dashed var(--gold);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: pulseOverlay 1.5s ease infinite alternate;
}

@keyframes pulseOverlay {
    from { border-color: var(--gold); background: rgba(99, 102, 241, 0.1); }
    to { border-color: var(--primary-light); background: rgba(212, 168, 83, 0.1); }
}

.drop-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-icon {
    font-size: 48px;
    animation: bounceDrop 0.8s ease infinite alternate;
}

@keyframes bounceDrop {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.drop-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

/* Chat Container needs position relative for overlay */
.chat-container {
    position: relative;
}

/* Message Attachments (in user messages) */
.msg-attachments {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.msg-attach-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: 8px;
    padding: 4px;
    max-width: 120px;
    overflow: hidden;
}

.msg-attach-img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

.msg-attach-file {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
}

.msg-attach-icon {
    font-size: 20px;
}

.msg-attach-name {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    display: block;
    text-align: center;
    margin-top: 2px;
}

/* Multimodal Loading Enhancement */
.multimodal-loading {
    border: 1px solid rgba(212, 168, 83, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(212, 168, 83, 0.08));
    border-radius: 12px;
    padding: 16px 20px;
}

.loading-substep {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 10px;
    background: rgba(10, 14, 26, 0.5);
    border-radius: 6px;
    border-left: 2px solid var(--gold);
    animation: fadeSlideUp 0.4s ease;
}

.substep-icon {
    font-size: 14px;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}


/* =====================================================
   ADMIN — API Sessions Panel Styles
   ===================================================== */

.adm-sessions-card {
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 20px;
    background: var(--bg-card);
}

/* Scope Checkboxes */
.scopes-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scope-check {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.scope-check:hover {
    border-color: var(--gold);
    color: var(--text-primary);
}

.scope-check input[type="checkbox"] {
    accent-color: var(--gold);
    cursor: pointer;
}

.scope-check input[type="checkbox"]:checked + span,
.scope-check:has(input:checked) {
    color: var(--gold-light);
}

/* Session Status Badges */
.session-status-active {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.session-status-revoked {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.session-status-expired {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Session scope pills */
.scope-pill {
    display: inline-block;
    padding: 2px 8px;
    margin: 1px 2px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Copy button */
.btn-copy-url {
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.3);
    color: var(--gold);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy-url:hover {
    background: rgba(212, 168, 83, 0.25);
    border-color: var(--gold);
}

.btn-revoke {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-revoke:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Session URL display modal */
.session-url-display {
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--gold-light);
    user-select: all;
}

/* Multi-Currency & Crypto Modal Checkout Styles */
.modal-checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-checkout-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(212, 168, 83, 0.15);
    padding: 24px;
    animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.payment-tab-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin: 16px 0;
    border-bottom: 1px solid var(--border);
}

.payment-tab-btn {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-tab-btn:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
}

.payment-tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(212, 168, 83, 0.2));
    border-color: var(--gold);
    color: var(--gold-light);
}

.crypto-pill-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.crypto-pill-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.crypto-pill-btn:hover {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.1);
}

.crypto-pill-btn.active {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.3), rgba(99, 102, 241, 0.3));
    border-color: var(--gold);
    color: #fff;
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.2);
}

.deposit-box-card {
    background: rgba(10, 14, 26, 0.9);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.deposit-addr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px;
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--gold-light);
}

.qr-visual-card {
    width: 140px;
    height: 140px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    margin: 0 auto 12px;
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.2);
}

/* Signal Markets Customization */
.tracked-markets-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(30, 41, 59, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(10px);
}

.market-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    color: #e2e8f0;
    transition: all 0.2s ease;
}

.market-chip:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(40, 53, 76, 0.95);
    transform: translateY(-1px);
}

.market-chip-icon {
    font-size: 0.9rem;
}

.market-chip-name {
    font-size: 0.75rem;
    color: #94a3b8;
}

.market-chip-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 0.15rem;
    font-size: 0.85rem;
    line-height: 1;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.market-chip-remove:hover {
    color: #ef4444;
}

.market-chip-add {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(99, 102, 241, 0.12);
    border: 1px dashed rgba(99, 102, 241, 0.4);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    color: #818cf8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.market-chip-add:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #818cf8;
    color: #fff;
    transform: translateY(-1px);
}

.market-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.market-preset-btn:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
    transform: translateY(-1px);
}

.market-preset-btn.is-active {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

/* ============ REAL-TIME PRICE FLASHES & PORTFOLIO BADGES ============ */
@keyframes priceFlashUp {
    0% { background-color: rgba(34, 197, 94, 0.35); color: #4ade80; border-radius: 4px; }
    100% { background-color: transparent; }
}

@keyframes priceFlashDown {
    0% { background-color: rgba(239, 68, 68, 0.35); color: #f87171; border-radius: 4px; }
    100% { background-color: transparent; }
}

.price-up {
    animation: priceFlashUp 1.2s ease-out;
}

.price-down {
    animation: priceFlashDown 1.2s ease-out;
}

.badge-paper {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.badge-live {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.filter-btn-active {
    background: var(--gold) !important;
    color: #000 !important;
    font-weight: 700 !important;
    border-color: var(--gold) !important;
}

/* ==========================================================================
   LABORATORIO CUANTITATIVO MLOPS UNAB (ESTILOS VISUALES PREMIUM)
   ========================================================================== */

.quant-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quant-control-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) 190px;
    gap: 1rem;
    align-items: flex-end;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 168, 83, 0.25);
    border-radius: 12px;
}

.quant-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.quant-card {
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.quant-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.6;
}

.regime-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.regime-tendencial_alcista {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.regime-tendencial_bajista {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.regime-rango_volatil {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.regime-rango_comprimido {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.direction-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.dir-sube {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
}

.dir-lateral {
    background: rgba(212, 168, 83, 0.2);
    color: var(--gold-light);
    border: 1px solid var(--gold);
    box-shadow: 0 0 16px rgba(212, 168, 83, 0.25);
}

.dir-baja {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
}

.prob-meter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.prob-label {
    width: 70px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.prob-bar-container {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.prob-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.prob-sube {
    background: linear-gradient(90deg, #16a34a, #22c55e);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.prob-lateral {
    background: linear-gradient(90deg, #d97706, #fbbf24);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.prob-baja {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.prob-val {
    width: 48px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: right;
    color: #fff;
}

.pulse-dot-green {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.kpi-quant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
}

.kpi-quant-card {
    background: rgba(10, 14, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-quant-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.kpi-quant-val {
    font-size: 1.25rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: #fff;
}

.quant-gating-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* --- TARJETA DE VEREDICTO EJECUTIVO (LENGUAJE NATURAL ACCIONABLE) --- */
.quant-verdict-card {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.85) 50%, rgba(212, 168, 83, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 12px;
    box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.verdict-icon-container {
    font-size: 2.2rem;
    line-height: 1;
    padding-top: 4px;
    filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.4));
}

.verdict-content {
    flex: 1;
}

.verdict-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.verdict-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

.verdict-text {
    font-size: 0.88rem;
    line-height: 1.55;
    color: #cbd5e1;
    margin: 0;
}

.verdict-action {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--gold);
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--gold-light);
    font-weight: 600;
}

/* --- SELECTOR DE VISTA: SIMPLE VS AVANZADA --- */
.view-mode-pill-container {
    display: inline-flex;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 3px;
    gap: 4px;
}

.view-mode-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-mode-btn.active {
    background: var(--gold);
    color: #0b0f19;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.3);
}

/* --- TOOLTIPS DIDÁCTICOS (ℹ️) --- */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 9px;
    font-style: normal;
    margin-left: 5px;
    transition: all 0.2s;
    user-select: none;
}

.tooltip-wrapper:hover .tooltip-icon {
    background: var(--gold);
    color: #000;
}

.tooltip-box {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    background: #0d1322;
    color: #e2e8f0;
    border: 1px solid rgba(212, 168, 83, 0.35);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    line-height: 1.45;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    text-align: left;
    font-weight: 400;
    text-transform: none;
}

.tooltip-box strong {
    color: var(--gold-light);
    display: block;
    margin-bottom: 2px;
}

.tooltip-wrapper:hover .tooltip-box {
    visibility: visible;
    opacity: 1;
}

/* --- OCULTAMIENTO DINÁMICO EN MODO SIMPLE --- */
.mode-simple .expert-element {
    display: none !important;
}

/* --- TEMA CLARO & OSCURO (LIGHT & DARK THEMES) --- */
html.light-theme,
body.light-theme {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border: rgba(15, 23, 42, 0.18);
    --border-subtle: rgba(15, 23, 42, 0.10);
    --border-hover: rgba(99, 102, 241, 0.55);
    --border-gold: rgba(184, 134, 11, 0.45);
    --text-primary: #090d16;
    --text-secondary: #1e293b;
    --text-muted: #475569;
    --card-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
    --card-shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
    --gold: #b8860b;
    --gold-light: #855306;
    --gold-dark: #633e04;
    --gold-glow: rgba(184, 134, 11, 0.18);
    background-color: #f1f5f9 !important;
    color: #090d16 !important;
}

/* Header & Sidebar */
body.light-theme .header {
    background-color: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.15) !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid rgba(15, 23, 42, 0.15) !important;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.03) !important;
}

body.light-theme .nav-item {
    color: #334155 !important;
    font-weight: 500;
}

body.light-theme .nav-item:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    color: #4338ca !important;
}

body.light-theme .nav-item.active {
    background: rgba(99, 102, 241, 0.14) !important;
    color: #4338ca !important;
    font-weight: 700;
}

/* Containers, Cards, Panels and Boxes */
body.light-theme .card,
body.light-theme .stat-card,
body.light-theme .metric-card,
body.light-theme .asset-card,
body.light-theme .chart-container,
body.light-theme .tracked-markets-card,
body.light-theme .orders-card,
body.light-theme .news-card,
body.light-theme .panel,
body.light-theme .content-card,
body.light-theme .trading-view-box {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.16) !important;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    color: #090d16 !important;
}

body.light-theme .card:hover,
body.light-theme .stat-card:hover,
body.light-theme .metric-card:hover {
    border-color: rgba(99, 102, 241, 0.45) !important;
    box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06) !important;
}

/* Headings and Typography in Light Mode */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme .card-title,
body.light-theme .section-title,
body.light-theme .stat-value,
body.light-theme .stat-number,
body.light-theme .metric-value,
body.light-theme strong,
body.light-theme [id^="cap-broker-"],
body.light-theme [id^="kpi-"] {
    color: #090d16 !important;
}

body.light-theme .stat-label,
body.light-theme .text-muted,
body.light-theme .card-subtitle {
    color: #475569 !important;
}

/* Neutralize hardcoded white / light text colors on light backgrounds */
body.light-theme [style*="color: #fff"]:not(.btn-primary):not(.btn-danger):not(.badge):not(.badge-success):not(.badge-danger):not(.badge-warning),
body.light-theme [style*="color:#fff"]:not(.btn-primary):not(.btn-danger):not(.badge):not(.badge-success):not(.badge-danger):not(.badge-warning),
body.light-theme [style*="color: white"]:not(.btn-primary):not(.btn-danger):not(.badge):not(.badge-success):not(.badge-danger):not(.badge-warning),
body.light-theme [style*="color: #f8fafc"],
body.light-theme [style*="color:#f8fafc"] {
    color: #090d16 !important;
}

body.light-theme [style*="color: #cbd5e1"],
body.light-theme [style*="color:#cbd5e1"] {
    color: #1e293b !important;
}

body.light-theme [style*="color: #94a3b8"],
body.light-theme [style*="color:#94a3b8"] {
    color: #475569 !important;
}

/* Keep white text explicitly on colored buttons & badges */
body.light-theme .btn-primary,
body.light-theme .btn-primary *,
body.light-theme .btn-danger,
body.light-theme .btn-danger *,
body.light-theme .badge-success,
body.light-theme .badge-danger,
body.light-theme .badge-warning {
    color: #ffffff !important;
}

/* Override inline dark boxes in Light Mode */
body.light-theme div[style*="background: rgba(15,22,38"],
body.light-theme div[style*="background: rgba(15, 22, 38"],
body.light-theme div[style*="background: rgba(15,23,42"],
body.light-theme div[style*="background: rgba(15, 23, 42"] {
    background: #f8fafc !important;
    border: 1px solid rgba(15, 23, 42, 0.16) !important;
    color: #090d16 !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) !important;
}

body.light-theme input[style*="background: #161f30"],
body.light-theme input[style*="background: #080c14"],
body.light-theme textarea[style*="background: #0f172a"],
body.light-theme textarea[style*="background: #161f30"],
body.light-theme select[style*="background: #0d1117"] {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.22) !important;
    color: #090d16 !important;
}

/* Inputs, Selects, and Form Controls */
body.light-theme input[type="text"],
body.light-theme input[type="password"],
body.light-theme input[type="number"],
body.light-theme input[type="search"],
body.light-theme input[type="email"],
body.light-theme input[type="url"],
body.light-theme select,
body.light-theme textarea {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.22) !important;
    color: #090d16 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
}

body.light-theme .lang-selector,
body.light-theme #quick-plan-override-select,
body.light-theme #quick-root-plan-select {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.22) !important;
    color: #090d16 !important;
}

/* Buttons */
body.light-theme .btn-secondary {
    background: #f1f5f9 !important;
    border: 1px solid rgba(15, 23, 42, 0.18) !important;
    color: #1e293b !important;
}

body.light-theme .btn-secondary:hover {
    background: #e2e8f0 !important;
    color: #090d16 !important;
    border-color: rgba(15, 23, 42, 0.25) !important;
}

body.light-theme .btn-ghost {
    color: #334155 !important;
}

body.light-theme .btn-ghost:hover {
    background: rgba(15, 23, 42, 0.08) !important;
    color: #090d16 !important;
}

/* Ticker Wrap */
body.light-theme .ticker-wrap {
    background-color: #ffffff !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.14) !important;
}

/* Segmented Space Bar (Paper / Demo / Live) */
body.light-theme .trading-spaces-segmented {
    background: #e2e8f0 !important;
    border: 1px solid rgba(15, 23, 42, 0.18) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .space-tab-btn {
    color: #475569 !important;
}

body.light-theme .space-tab-btn:hover {
    color: #090d16 !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .space-tab-btn.active[data-space="paper"] {
    background: #ffffff !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.18) !important;
}

body.light-theme .space-tab-btn.active[data-space="demo"] {
    background: #ffffff !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.18) !important;
}

body.light-theme .space-tab-btn.active[data-space="live"] {
    background: #ffffff !important;
    color: #b91c1c !important;
    border: 1px solid #fca5a5 !important;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.18) !important;
}

/* Segmented Complexity Bar (Basic vs Pro) */
body.light-theme .complexity-segmented {
    background: #e2e8f0 !important;
    border: 1px solid rgba(15, 23, 42, 0.18) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .complexity-tab-btn {
    color: #475569 !important;
}

body.light-theme .complexity-tab-btn:hover {
    color: #090d16 !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .complexity-tab-btn.active {
    background: #ffffff !important;
    color: #0284c7 !important;
    border: 1px solid #7dd3fc !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.18) !important;
}

/* Bottom Navigation */
body.light-theme .bottom-nav {
    background: rgba(255, 255, 255, 0.98) !important;
    border-top: 1px solid rgba(15, 23, 42, 0.15) !important;
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .bottom-nav-item {
    color: #475569 !important;
}

body.light-theme .bottom-nav-item.active,
body.light-theme .bottom-nav-item:hover {
    color: #4338ca !important;
}

/* Data Tables */
body.light-theme .table {
    color: #090d16 !important;
}

body.light-theme .table th {
    background-color: #f1f5f9 !important;
    color: #090d16 !important;
    font-weight: 700 !important;
    border-bottom: 2px solid rgba(15, 23, 42, 0.18) !important;
}

body.light-theme .table td {
    color: #1e293b !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.10) !important;
}

body.light-theme .table tr:hover {
    background-color: rgba(99, 102, 241, 0.05) !important;
}

/* Chat & Oracle */
body.light-theme .chat-container,
body.light-theme .chat-messages {
    background: #f8fafc !important;
}

body.light-theme .chat-message.oracle {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.16) !important;
    color: #090d16 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .chat-message.user {
    background: rgba(99, 102, 241, 0.12) !important;
    border: 1px solid rgba(99, 102, 241, 0.28) !important;
    color: #090d16 !important;
}

body.light-theme .chat-input-bar {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.18) !important;
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.04) !important;
}

/* Modals */
body.light-theme .modal-card,
body.light-theme .adm-modal-card {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.2) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18) !important;
    color: #090d16 !important;
}

/* Dropzones */
body.light-theme #ingest-dropzone,
body.light-theme #qr-dropzone,
body.light-theme .dropzone {
    background: #f8fafc !important;
    border: 2px dashed rgba(14, 165, 233, 0.45) !important;
    color: #090d16 !important;
}

body.light-theme #ingest-dropzone:hover,
body.light-theme #qr-dropzone:hover,
body.light-theme .dropzone:hover {
    background: #f0f9ff !important;
    border-color: #0284c7 !important;
}

/* Kbd & Code */
body.light-theme kbd {
    background: #e2e8f0 !important;
    color: #090d16 !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme pre,
body.light-theme code {
    background: #f1f5f9 !important;
    color: #090d16 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Guides & Panels */
body.light-theme .guide-tab-panel {
    background: #ffffff !important;
    color: #090d16 !important;
}

body.light-theme .guide-tab-btn {
    color: #475569 !important;
}

body.light-theme .guide-tab-btn.active {
    background: #ffffff !important;
    color: #b8860b !important;
    border-color: rgba(184, 134, 11, 0.45) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

/* Execution Pill in Portfolio */
body.light-theme .portfolio-controls #portfolio-execution-pill {
    background: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid rgba(22, 163, 74, 0.4) !important;
    color: #15803d !important;
}

body.light-theme .portfolio-controls #btn-open-qr-link-modal {
    background: rgba(2, 132, 199, 0.1) !important;
    border: 1px solid rgba(2, 132, 199, 0.35) !important;
    color: #0284c7 !important;
}

body.light-theme .portfolio-controls #btn-open-qr-link-modal:hover {
    background: rgba(2, 132, 199, 0.18) !important;
    border-color: #0284c7 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
}

body.light-theme .sacred-geometry {
    opacity: 0.12;
}

/* --- ESPACIOS OPERATIVOS (TRADING SPACES SEGMENTED) --- */
.trading-spaces-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.space-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1.25;
}

.space-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.space-tab-btn.active[data-space="paper"] {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.45);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.space-tab-btn.active[data-space="demo"] {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.space-tab-btn.active[data-space="live"] {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.space-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-paper {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

.dot-demo {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

.dot-real {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

/* --- SELECTOR DE NIVEL DE COMPLEJIDAD (BÁSICO VS PRO QUANT) --- */
.complexity-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.complexity-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1.25;
}

.complexity-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.complexity-tab-btn.active[data-mode="basic"],
.complexity-tab-btn.active[data-complexity="basic"] {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.complexity-tab-btn.active[data-mode="pro"],
.complexity-tab-btn.active[data-complexity="pro"] {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.45);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

/* Reglas de Ocultación y Reducción de Sobrecarga Cognitiva */
body.complexity-basic .pro-quant-only,
body.complexity-basic .pro-quant-only-panel,
body.complexity-basic .expert-element,
body.complexity-basic .pro-column,
body.complexity-basic .pro-metric,
body.complexity-basic th.pro-quant-column,
body.complexity-basic td.pro-quant-column {
    display: none !important;
}

body.complexity-basic .basic-only-view,
body.complexity-basic .basic-only-panel {
    display: block !important;
}

body.complexity-pro .basic-only-view {
    display: none !important;
}

body.complexity-pro .pro-quant-only,
body.complexity-pro .pro-quant-only-panel,
body.complexity-pro .expert-element {
    display: block !important;
}

/* Enhanced Toasts */
.toast {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: #f8fafc;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}
.toast-success { border-color: rgba(34, 197, 94, 0.5); }
.toast-error { border-color: rgba(239, 68, 68, 0.5); }
.toast-warning { border-color: rgba(245, 158, 11, 0.5); }
.toast-info { border-color: rgba(56, 189, 248, 0.5); }

/* Split View Layout para Mercados & Señales */
.split-view-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: 15px;
    min-width: 0;
}

.split-view-left, .split-view-right {
    min-width: 0;
    width: 100%;
}

@media (max-width: 1024px) {
    .split-view-container {
        grid-template-columns: 1fr;
    }
}

/* Pulsing Safety Indicator for Live Production Trading */
@keyframes pulseRed {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.btn-hitl-live {
    animation: pulseRed 2s infinite !important;
}

/* --- FILA DE ACCIONES E INDICADORES OPERATIVOS (PORTFOLIO CONTROLS) --- */
.portfolio-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.portfolio-controls > button,
.portfolio-controls > .btn,
.portfolio-controls > .badge,
.portfolio-controls > div,
.portfolio-controls #portfolio-execution-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    height: 36px;
    box-sizing: border-box;
    border-radius: 8px;
    vertical-align: middle;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-controls #portfolio-execution-pill {
    cursor: pointer;
    border: 1px solid rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.portfolio-controls #portfolio-mode-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    flex-shrink: 0;
}

.portfolio-controls #btn-open-qr-link-modal {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-controls #btn-open-qr-link-modal:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
    transform: translateY(-1px);
}

@keyframes scanLaser {
    0% { top: 0%; opacity: 0.3; }
    50% { top: 100%; opacity: 1; }
    100% { top: 0%; opacity: 0.3; }
}



/* PWA Installation & Direct Shortcut Button Styles */
.btn-pwa-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.15), rgba(99, 102, 241, 0.15));
    color: var(--gold-light, #f6e05e);
    border: 1px solid rgba(212, 168, 83, 0.45);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-pwa-header:hover {
    background: linear-gradient(135deg, #d4a853, #b8860b);
    color: #070a13;
    border-color: #d4a853;
    box-shadow: 0 0 16px rgba(212, 168, 83, 0.45);
    transform: translateY(-1px);
}

.pulse-gold {
    animation: pulseGoldGlow 2s infinite ease-in-out;
}

@keyframes pulseGoldGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 168, 83, 0.6);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(212, 168, 83, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 168, 83, 0);
    }
}
