@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* DEFAULT: LIGHT MODE (Institutional White) */
    --bg: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.06);
    --primary: #2563eb;
    --secondary: #7c3aed;
    --accent: #e11d48;
    --success: #059669;
    --danger: #dc2626;
    --text-main: #0f172a;
    --text-dim: #64748b;
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --glass: blur(10px) saturate(150%);
}

body.dark-mode {
    --bg: #030408;
    --card-bg: rgba(13, 17, 23, 0.6);
    --card-border: rgba(255, 255, 255, 0.05);
    --primary: #3b82f6;
    --secondary: #8b5cf6;
    --text-main: #f8fafc;
    --text-dim: #64748b;
    --glass: blur(12px) saturate(180%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
}

/* --- MAIN LAYOUT --- */
.dashboard-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 50px; /* spacing for ticker */
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

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

/* --- TICKER SECTION --- */
.ticker-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 44px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: var(--glass);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: scroll 100s linear infinite; /* Adjusted speed to be slower */
    will-change: transform;
}

.ticker-group {
    display: flex;
    flex-shrink: 0;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Shifts exactly one full group out of the two */
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 3rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    height: 100%;
    border-right: 1px solid var(--card-border);
}

.ticker-symbol {
    font-weight: 700;
    margin-right: 0.5rem;
    color: var(--text-main);
}

.ticker-price {
    color: var(--text-dim);
    margin-right: 0.5rem;
}

.ticker-change {
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
}

.ticker-change.up { color: var(--success); }
.ticker-change.down { color: var(--danger); }

/* --- HEADER & TOGGLE --- */
.hero {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- MODAL OVERLAY --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.3s ease;
}

.modal-content.glass {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8);
    color: var(--text-main);
}

/* Forzamos visibilidad de textos en el modal independientemente del tema */
.liq-section h4 {
    color: var(--text-main) !important;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.liq-section p.stat-sub {
    color: var(--text-dim) !important;
    font-size: 0.85rem;
    opacity: 1 !important;
    line-height: 1.4;
}

.input-group-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group-row input, 
.input-group-row select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

body.dark-mode .input-group-row input,
body.dark-mode .input-group-row select {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

#liq-calc-preview {
    margin-top: 0.8rem;
    padding: 1.2rem;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.hero-logo {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.theme-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    backdrop-filter: var(--glass);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.theme-btn:hover {
    transform: scale(1.2);
}

/* --- NEWS MODULE STYLES --- */
.news-tabs {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.news-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    border-radius: 8px;
}

.news-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.news-tab-btn.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.news-tab-content {
    display: none;
    margin-top: 1.5rem;
}

.news-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.news-status-banner {
    background: rgba(5, 150, 105, 0.1);
    border-left: 4px solid var(--success);
    padding: 1rem;
    border-radius: 4px 8px 8px 4px;
    margin-bottom: 1.5rem;
    color: var(--success);
    font-weight: 600;
}

.ai-summary-bubble {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    line-height: 1.6;
    color: var(--text-main);
    margin: 1rem 0;
    font-size: 1rem;
}

.news-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.news-card-premium {
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    border-radius: 12px;
    transition: transform 0.2s, border-color 0.2s;
}

.news-card-premium:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.news-card-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: block;
    text-decoration: none;
}

.news-card-title:hover {
    color: var(--primary);
}

.news-card-summary {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.scout-card-premium {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.scout-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.scout-body {
    padding: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.divider-premium {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 2rem 0;
}

.section-title-premium {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.report-paper {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
}

.report-paper h1, .report-paper h2, .report-paper h3 {
    color: var(--primary);
    margin-top: 1.5rem;
}

.sentiment-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sentiment-positive { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.sentiment-negative { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.sentiment-neutral { background: rgba(107, 114, 128, 0.1); color: var(--text-dim); }

/* --- AI INTELLIGENCE & PDF STYLES --- */
.glass-report {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8)) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.intel-timestamp-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    border-left: 4px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 4px 8px 8px 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.sources-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.source-item {
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
}

.source-header {
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.source-body {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.1);
}

.source-link {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.source-link:hover { text-decoration: underline; }

.intel-recommendations {
    background: rgba(16, 185, 129, 0.08);
    border-left: 4px solid var(--success);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.pill-grid-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.breakdown-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
}

.breakdown-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Global Loader */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
.global-loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-content {
    text-align: center;
}
.titan-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Security Overlay */
.security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.login-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
}
.login-box h2 {
    color: var(--text-color);
    margin-bottom: 10px;
}
.login-input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 15px;
}
.login-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

/* Visits Badge */
.visits-badge {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

/* --- HEADER LINKS --- */
.header-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s;
}

.social-link:hover {
    color: #0077b5; /* LinkedIn Blue */
}

.icon-linkedin {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    min-height: 20px;
    fill: currentColor;
    display: inline-block;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: opacity 0.3s;
}

.text-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* --- OVERVIEW GRID --- */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: var(--glass);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card.glow-blue::before { opacity: 1; background: var(--primary); }
.stat-card.glow-purple::before { opacity: 1; background: var(--secondary); }

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.05em;
    margin-bottom: 0.2rem;
}

.stat-sub {
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
}

.card-footer-data {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--card-border);
}

/* --- MARKET SENTINEL --- */
.sentinel-card {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(5, 150, 105, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.macro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.02);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.macro-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.macro-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.macro-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.macro-sub {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.sentinel-help {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-main);
    opacity: 0.9;
    padding: 0.5rem 0;
}

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

/* --- MODAL SYSTEM --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--bg);
    margin: 4vh auto;
    padding: 3rem;
    border: 1px solid var(--card-border);
    width: 85%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 24px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    right: 2rem;
    top: 1.5rem;
    font-size: 2.5rem;
    color: var(--text-dim);
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-main);
}

/* --- STRATEGY DOC STYLES --- */
.strategy-doc {
    line-height: 1.6;
}

.doc-header {
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.doc-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.doc-intro {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 1.1rem;
}

.doc-section {
    margin-bottom: 2.5rem;
}

.doc-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.doc-section p {
    margin-bottom: 1rem;
}

.doc-section ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.doc-section li {
    margin-bottom: 0.75rem;
}

.formula-box {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    text-align: center;
    font-size: 1.1rem;
    margin: 1.5rem 0;
}

.protection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.protection-item {
    background: rgba(0, 0, 0, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.prot-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.regime-box {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 4px solid transparent;
}

.regime-box.sano { 
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), transparent); 
    border-left: 5px solid var(--success); 
    box-shadow: -10px 0 20px rgba(16, 185, 129, 0.05);
}
.regime-box.warning { 
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), transparent); 
    border-left: 5px solid #f59e0b; 
    box-shadow: -10px 0 20px rgba(245, 158, 11, 0.05);
}
.regime-box.crisis { 
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), transparent); 
    border-left: 5px solid var(--danger); 
    box-shadow: -10px 0 20px rgba(239, 68, 68, 0.05);
    animation: pulseDanger 2s infinite;
}

/* --- CRISIS SHIELD SECTION --- */
.crisis-shield-container {
    margin-top: 2rem;
    animation: fadeIn 1s ease;
}

.crisis-shield-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    overflow: hidden;
    padding: 0 !important;
}

.crisis-header {
    background: rgba(37, 99, 235, 0.05);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.crisis-header:hover {
    background: rgba(37, 99, 235, 0.08);
}

.chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--text-dim);
}

.crisis-body {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 1;
}

.crisis-body.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.crisis-header.active .chevron {
    transform: rotate(180deg);
}

.tv-widget-box {
    margin-top: 1.5rem;
    width: 100%;
    height: 450px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.crisis-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.crisis-title h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin: 0;
}

.crisis-title p {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
    margin: 0;
}

.crisis-content {
    padding: 2rem;
}

.detector-box {
    background: rgba(59, 130, 246, 0.1);
    padding: 1.5rem;
    border-radius: 16px;
    border-left: 5px solid var(--primary);
    margin-bottom: 2rem;
}

.detector-box h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    margin-top: 0;
}

.detector-box p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
    margin: 0;
}

.macro-grid-detailed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.macro-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    border-radius: 16px;
    text-align: center;
}

.macro-item .label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.macro-item .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.macro-item .sub-value {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

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

.ai-investigation {
    text-align: center;
    padding: 2rem;
    background: rgba(124, 58, 237, 0.05);
    border-radius: 20px;
    border: 1px dashed rgba(124, 58, 237, 0.3);
}

.ai-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ai-status .icon {
    font-size: 2.5rem;
}

.ai-status p {
    font-weight: 500;
    color: var(--text-dim);
    margin: 0;
}

.primary-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.nav-item {
    padding: 0.8rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-dim);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item i, .nav-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5px;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.nav-item.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

/* Global Lucide alignment */
[data-lucide] {
    vertical-align: middle;
    margin-top: -2px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.ai-report-container {
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#report-time {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.report-paper {
    background: var(--bg);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    font-size: 1rem;
    line-height: 1.7;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    max-height: 600px;
    overflow-y: auto;
}

.report-paper h1, .report-paper h2, .report-paper h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.report-paper p {
    margin-bottom: 1rem;
}

.report-paper ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.report-paper li {
    margin-bottom: 0.5rem;
}

/* --- NEWS CARD STYLES (FROM STREAMLIT) --- */
.news-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: rgba(102, 126, 234, 0.5);
}

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

.news-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.news-date {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.news-title {
    color: #667eea;
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.news-summary {
    color: var(--text-dim);
    margin: 0.75rem 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.news-source {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.news-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.news-link:hover {
    transform: scale(1.05);
}

/* --- NAVIGATION MENU --- */
.main-nav {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}

.main-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.nav-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    backdrop-filter: var(--glass);
}

.nav-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* --- MODULAR SECTIONS --- */
.module-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.module-section.active {
    display: block;
}

/* --- INFO ICON --- */
.info-icon-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
}

.info-icon-btn:hover {
    opacity: 1;
}

/* --- CUSTOM MODAL ADJUSTMENTS --- */
#sentinel-modal .modal-content {
    background: var(--bg);
    border-left: 8px solid var(--primary);
}

/* --- ROTATION MODULE REDESIGN (ULTRA PREMIUM) --- */
.rotation-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.rot-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: var(--glass);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

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

.rot-card.fast::before { background: #ef4444; }
.rot-card.manual::before { background: var(--secondary); }

.ticker-preview-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
    min-height: 1.2rem;
    transition: all 0.3s ease;
}

.ticker-preview-info.error {
    color: #ef4444;
}

/* --- Market Summary Bar --- */
.market-summary-bar {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    margin: 0 1.5rem 1.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.text-bull { color: #10b981; }
.text-bear { color: #ef4444; }

/* --- RISK CENTRAL BAR --- */
.risk-central-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    margin: 1rem 1.5rem 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

.risk-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.risk-icon-box {
    width: 44px;
    height: 44px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.risk-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.risk-text {
    display: flex;
    flex-direction: column;
}

.risk-title {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

.risk-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
}

.risk-actions {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.safety-switch-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.switch-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: .4s;
}

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

input:checked + .slider { background-color: var(--danger); }
input:checked + .slider:before { transform: translateX(24px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* Action Buttons */
.risk-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.sell-btn {
    background: var(--danger);
    color: white;
}

.sell-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.liquidation-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.input-group-row input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.6rem;
    color: white;
    font-family: 'JetBrains Mono', monospace;
}

.rot-title-area h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rot-subtitle {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 800px;
}

.rot-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 1100px) {
    .rot-main-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.rot-control-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-label-premium {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    display: block;
}

.select-premium, .field-premium {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.02);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.select-premium:focus, .field-premium:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
}

.rec-box-premium {
    background: rgba(37, 99, 235, 0.05);
    border: 2px dashed var(--primary);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    margin-top: 1rem;
    animation: pulseGlow 4s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.1); }
    50% { box-shadow: 0 0 20px 5px rgba(37, 99, 235, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.1); }
}

.rot-badge-premium {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.rot-metrics-display {
    background: rgba(0, 0, 0, 0.015);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--card-border);
}

.metrics-title-premium {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pills-grid-premium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.pill-premium {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.pill-premium:hover { transform: translateY(-5px); border-color: var(--primary); }

.pill-label-premium {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.pill-value-premium {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
}

.rot-footer-premium {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.pass-field-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pass-input-premium {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid var(--card-border);
    background: rgba(0, 0, 0, 0.02);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
}

.btn-execute-premium {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-execute-premium:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
}

.btn-execute-premium.fast {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.2);
}

.btn-execute-premium.fast:hover {
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.3);
}

.keep-section-premium {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(124, 58, 237, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(124, 58, 237, 0.1);
}

.keep-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.keep-title-premium {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.keep-grid-premium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .keep-grid-premium { grid-template-columns: 1fr; }
    .rot-footer-premium { grid-template-columns: 1fr; }
}

/* --- STOP CONTROL CENTER STYLES --- */
.stops-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stop-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

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

.pnl-summary-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

.stop-pos-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stop-pos-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.stop-pos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stop-pos-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stop-pos-ticker {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

.stop-type-tag {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tag-atr { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.tag-hard { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.tag-fm { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.tag-crypto { background: rgba(139, 92, 246, 0.1); color: var(--secondary); }

.margin-visualizer {
    margin: 2rem 0;
}

.margin-bar-container {
    height: 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.margin-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.stop-data-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
}

@media (max-width: 1000px) {
    .stop-data-grid { grid-template-columns: 1fr; }
}

.manual-adj-panel {
    background: rgba(0,0,0,0.01);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px dashed var(--card-border);
}

.adj-control {
    margin-bottom: 2rem;
}

.adj-preview {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    border: 1px solid var(--card-border);
}

/* Custom range slider styling */
.premium-range {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    margin: 1.5rem 0;
}

.premium-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.premium-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* --- TECHNICAL ANALYSIS PREMIUM STYLES --- */
.tech-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tech-card-pro {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    height: 100%;
}

.tech-card-pro:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
}

.tech-main-layout {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tech-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.tech-status-bullish {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.tech-status-bearish {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tech-status-neutral {
    background: rgba(148, 163, 184, 0.1);
    color: #64748b;
}

.tech-indicator-value-large {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-main);
    display: block;
}

.tech-chart-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
}

/* Plotly customization */
.tech-chart-container {
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.fibo-level-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.fibo-level-label { color: var(--text-dim); font-weight: 500; }
.fibo-level-price { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--text-main); }

/* Quick Insights */
.tech-insight-box {
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    border-radius: 0 12px 12px 0;
    margin-top: 1.5rem;
}

.tech-insight-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.tech-insight-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-dim);
}

/* Animations */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-slide-right {
    animation: slideInRight 0.4s ease-out forwards;
}

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

/* --- PROFESSIONAL MARKET HEATMAP (GOD MODE) --- */
.heatmap-card-premium {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 2.5rem;
    backdrop-filter: var(--glass);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.card-header-pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.icon-box-fire {
    font-size: 1.8rem;
    background: rgba(239, 68, 68, 0.1);
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.pro-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.pro-subtitle {
    font-size: 0.95rem;
    color: var(--text-dim);
}

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

.filter-group {
    display: flex;
    gap: 0.75rem;
    background: rgba(0,0,0,0.03);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.pro-select {
    background: var(--bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.pro-select:hover {
    border-color: var(--primary);
}

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

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    opacity: 0.5;
}

.pro-search {
    background: var(--bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    font-size: 0.85rem;
    width: 180px;
    outline: none;
    transition: all 0.3s;
}

.pro-search:focus {
    width: 240px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pro-btn-icon {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pro-btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.heatmap-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-rows: 100px;
    gap: 8px;
    max-height: 800px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.02);
    border-radius: 16px;
    scrollbar-width: thin;
}

.heatmap-tile {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    padding: 10px;
    text-align: center;
}

.heatmap-tile:hover {
    transform: scale(1.1);
    z-index: 100;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.tile-symbol {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.tile-change {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.9;
}

.tile-mom {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    opacity: 0.7;
}

/* Pro Intensity (Symmetric and Institutional) */
.intensity-0 { background: rgba(148, 163, 184, 0.08); border-color: rgba(148, 163, 184, 0.1); }
.neut { background: rgba(148, 163, 184, 0.1); }

.bull-1 { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.2); }
.bull-2 { background: rgba(16, 185, 129, 0.3); border-color: rgba(16, 185, 129, 0.4); }
.bull-3 { background: rgba(16, 185, 129, 0.45); border-color: rgba(16, 185, 129, 0.6); }
.bull-4 { background: rgba(16, 185, 129, 0.65); border-color: rgba(16, 185, 129, 0.8); }

.bear-1 { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.2); }
.bear-2 { background: rgba(239, 68, 68, 0.3); border-color: rgba(239, 68, 68, 0.4); }
.bear-3 { background: rgba(239, 68, 68, 0.45); border-color: rgba(239, 68, 68, 0.6); }
.bear-4 { background: rgba(239, 68, 68, 0.65); border-color: rgba(239, 68, 68, 0.8); }

.heatmap-footer-pro {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
}

.leg-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

#heatmap-wrapper:fullscreen {
    background: #05070a !important;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

#heatmap-wrapper:fullscreen .heatmap-grid-pro {
    max-height: none;
    flex: 1;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: 140px;
    gap: 15px;
}
/* ========================================== 
   ?? RESPONSIVE DESIGN (MOBILE & TABLET) 
   ========================================== */

/* Tablet & Smaller Desktop */
@media (max-width: 1024px) {
    .dashboard-container {
        padding: 1rem;
    }
    
    .overview-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .main-nav {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .nav-item {
        white-space: nowrap;
        padding: 0.6rem 1rem;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .header-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-logo {
        font-size: 1.8rem;
    }
    
    .overview-grid {
        grid-template-columns: 1fr !important;
    }
    
    .stat-card {
        padding: 1.2rem;
    }
    
    .stat-value {
        font-size: 2rem !important;
    }
    
    .macro-grid-detailed {
        grid-template-columns: 1fr !important;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr !important;
    }
    
    .stat-card[style*=" grid-column: span 3\] {
 grid-column: span 1 !important;
 }
 
 /* Optimize Charts for Mobile */
 .tech-main-layout {
 grid-template-columns: 1fr !important;
 }
 
 .theme-btn {
 position: absolute;
 top: 1rem;
 right: 1rem;
 }
}

/* Extra Small Devices */
@media (max-width: 480px) {
 .hero-subtitle {
 font-size: 0.8rem;
 }
 
 .nav-item {
 font-size: 0.8rem;
 }
 
 .macro-label {
 font-size: 0.7rem;
 }
}

/* Theme Toggle Button Style */
.theme-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: var(--glass);
    z-index: 1001;
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

/* --- BACKTESTING MODULE STYLES --- */
.backtest-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.backtest-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metrics-list-premium {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-item-pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.95rem;
}

.metric-item-pro:last-child {
    border-bottom: none;
}

.metric-item-pro span:first-child {
    color: var(--text-dim);
    font-weight: 500;
}

/* Status Tags for Stops/Backtest */
.stop-type-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
}
.tag-crypto { background: rgba(247, 147, 26, 0.1); color: #f7931a; }
.tag-fm { background: rgba(248, 113, 113, 0.1); color: #f87171; }
.tag-atr { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.tag-hard { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
