/* Core Styling & Variables */
/* --- App Loader (Premium Glassmorphism) --- */
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0d14; /* Deep dark background */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
    backdrop-filter: blur(20px);
}

#app-loader.loader-faded {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    animation: loaderScale 0.8s ease-out;
}

.loader-spinner-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(46, 204, 113, 0.1);
    border-top: 3px solid var(--accent-green);
    border-radius: 50%;
    animation: loaderSpin 1.4s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-pulsar {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: loaderPulse 2s infinite;
}

.loader-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: var(--accent-green);
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
    animation: loaderIconPop 2s infinite alternate;
}

.loader-status {
    margin-top: 20px;
}

.loader-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#loader-message {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 500;
    text-transform: uppercase;
}

@keyframes loaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loaderPulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(0.9); opacity: 0.5; }
}

@keyframes loaderIconPop {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

@keyframes loaderScale {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Application Footer --- */
.app-footer {
    position: sticky;
    bottom: 0;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
    flex-shrink: 0;
    background: rgba(19, 19, 22, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
}

.footer-left-spacer {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.footer-copyright {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.footer-separator {
    color: rgba(255, 255, 255, 0.1);
    font-size: 10px;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--accent-green);
}

.footer-status {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .app-footer {
        flex-direction: column-reverse;
        padding: 16px 20px;
        gap: 12px;
        position: relative; /* Avoid stickiness on mobile if it blocks content */
    }
    
    .footer-left-spacer {
        display: none;
    }
    
    .footer-copyright {
        font-size: 11px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .footer-status {
        justify-content: center;
        width: 100%;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }
}

/* --- Premium Banners --- */
.premium-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(27, 27, 28, 0.95) 0%, rgba(22, 23, 26, 0.95) 100%);
    padding: 20px 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.banner-icon-box {
    width: 48px;
    height: 48px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.4);
    flex-shrink: 0;
}

.banner-text h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.banner-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.banner-action-btn {
    background: var(--accent-green);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.banner-action-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

@media (max-width: 768px) {
    .premium-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }
    
    .banner-content {
        gap: 15px;
    }
    
    .banner-text h3 {
        font-size: 16px;
    }
    
    .banner-text p {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .banner-action-btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Responsive Tables & Overlays --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 12px;
}

/* Ensure registry and quick reference tables don't look cramped */
.table-responsive .data-table {
    min-width: 600px;
}

@media (max-width: 768px) {
    .hist-params-row {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .hist-params-row .hist-input-group {
        width: 100% !important;
        overflow: hidden !important;
        min-width: 0 !important;
    }
    
    .hist-params-row .editable-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        font-size: 14px !important;
        padding: 12px 10px !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        height: 44px !important;
    }
}

/* --- Self Learn Card System (Premium Mobile UI) --- */
.sl-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.sl-ref-card {
    background: rgba(18, 20, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.sl-ref-card:hover {
    border-color: rgba(46, 204, 113, 0.3);
    transform: translateY(-4px);
}

.sl-ref-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sl-ref-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-green);
    letter-spacing: -0.5px;
    margin: 0;
}

.sl-ref-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(46, 204, 113, 0.1);
    color: var(--accent-green);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.sl-ref-category {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -10px;
}

.sl-ref-measure-box {
    margin-top: 5px;
}

.sl-ref-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: block;
}

.sl-ref-measure-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.sl-ref-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
}

.sl-val-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.sl-val-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 6px;
}

.sl-val-label.ideal { color: #2ecc71; }
.sl-val-label.warning { color: #e74c3c; }

.sl-val-text {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

@media (max-width: 600px) {
    .sl-ref-grid {
        grid-template-columns: 1fr;
    }
    
    .sl-ref-values {
        grid-template-columns: 1fr;
    }
}

/* Base Styles Continued... */
:root {

    --bg-base: #131316;
    --bg-glass: rgba(29, 30, 37, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f1f3f5;
    --text-muted: #8b92a5;
    
    --accent-cyan: #00d2ff;
    --accent-purple: #9b51e0;
    --accent-green: #27ae60;
    --accent-red: #ff4757;
    
    --font-stack: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}



.sidebar {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 240px;
    background: #1e1f23;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 24px 12px;
    height: calc(100vh - 32px);
    border-radius: 12px;
    box-shadow: none; /* Completely flat, no shadow */
    z-index: 1000;
    transition: transform 0.3s ease;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(calc(-100% - 32px));
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
}

.sidebar-header {
    padding: 0 16px;
    margin-bottom: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}


.logo h2 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, #27ae60, #c7ff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-btn {
    position: relative;
    background: transparent;
    border: none;
    color: #94a3b8;
    text-align: left;
    padding: 10px 16px;
    border-radius: 6px;
    font-family: var(--font-stack);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: none !important; 
    animation: none !important; 
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn:hover {
    background: #23262b; 
    color: #f8fafc;
}

.nav-btn.active {
    background: #16171a; /* Flat color only, no gradients */
    color: #f8fafc;
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 2px;
    background: #2ecc71;
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    flex-shrink: 0;
    stroke-width: 2;
    opacity: 0.9;
    transition: none !important;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #334155;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-profile-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.theme-toggle-btn:hover {
    background: #23262b;
    color: #f8fafc;
}



.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 0 32px 0 32px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 240px);
    transition: margin-left 0.3s ease;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 0 20px 0 20px;
        width: 100%;
    }
    #mobile-menu-btn {
        display: block !important;
    }
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    margin-top: 0;
}

.top-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    padding-top: 14px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn {
    font-family: var(--font-stack);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--border-glass);
    border-color: var(--text-muted);
}



.profile-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    cursor: pointer;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-pane.active {
    display: block;
    flex: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 600;
}

.kpi-indicator {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    width: fit-content;
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-red);
}

.highlight-green { color: var(--accent-green); }
.highlight-green { color: var(--accent-green); }
.highlight-red { color: var(--accent-red); }

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}

.canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.table-container {
    padding: 24px;
    overflow-x: auto;
}

.table-container h3 {
    margin-bottom: 20px;
}

/* --- Profit Strategy Info Boxes --- */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.strategy-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.strategy-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.8;
}

.strategy-card h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strategy-card .strat-content {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.strategy-card .strat-label {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-top: 4px;
    opacity: 0.9;
}

/* Color Themes */
.strat-tp1 { border-color: rgba(46, 204, 113, 0.2); }
.strat-tp1::before { background: var(--accent-green); }
.strat-tp1 h4 { color: var(--accent-green); }

.strat-tp2 { border-color: rgba(26, 188, 156, 0.2); }
.strat-tp2::before { background: #1abc9c; }
.strat-tp2 h4 { color: #1abc9c; }

.strat-tp3 { border-color: rgba(155, 89, 182, 0.2); }
.strat-tp3::before { background: #9b59b6; }
.strat-tp3 h4 { color: #9b59b6; }

.strat-hold { border-color: rgba(241, 196, 15, 0.2); }
.strat-hold::before { background: #f1c40f; }
.strat-hold h4 { color: #f1c40f; }

.strat-sl { border-color: rgba(231, 76, 60, 0.2); }
.strat-sl::before { background: #e74c3c; }
.strat-sl h4 { color: #e74c3c; }

@media (max-width: 1200px) {
    .strategy-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .strategy-grid { grid-template-columns: 1fr; }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-red {
    background: rgba(255, 71, 87, 0.2);
    color: var(--accent-red);
    border: 1px solid rgba(255, 71, 87, 0.5);
}

.badge-green {
    background: rgba(46, 204, 113, 0.2);
    color: var(--accent-green);
    border: 1px solid rgba(46, 204, 113, 0.5);
}



@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Light Theme Overrides */
body.light-theme {
    --bg-base: #f8f9fa;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-main: #1a1d27;
    --text-muted: #5c677d;
    --accent-cyan: #0096c7;
    --accent-green: #27ae60;
    --accent-red: #e74c3c;
}

body.light-theme .glass-panel {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

body.light-theme .kpi-indicator {
    background: rgba(255, 71, 87, 0.1);
}

body.light-theme .logo h2 {
    background: linear-gradient(90deg, #27ae60, #c7ff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Sidebar stays dark in both themes; force correct colors */
body.light-theme .nav-btn {
    color: #94a3b8 !important;
}

body.light-theme .nav-btn.active {
    color: #f8fafc !important;
}

body.light-theme .sb-search-box {
    background: rgba(0, 0, 0, 0.01) !important;
}

body.light-theme .learn-indicator-ex {
    background: rgba(0, 0, 0, 0.07) !important;
}

body.light-theme .admin-pro-card {
    background: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .admin-keys-vault {
    background: rgba(0, 0, 0, 0.07) !important;
}

/* Editable Transaction UI */
.table-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 8px 4px;
}

.table-header-flex h3,
.cf-panel-header h3 {
    margin-bottom: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
}

/* ── Mobile: table-header stacking ── */
@media (max-width: 768px) {
    .table-header-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
        padding: 12px 8px !important;
    }

    .table-header-flex h3,
    .cf-panel-header h3 {
        font-size: 15px !important;
    }

    .table-header-flex .header-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .table-header-flex .header-actions .btn,
    .table-header-flex .header-actions .btn-outline {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    .table-header-flex .header-actions .brokerage-badge {
        width: auto !important;
        display: flex !important;
    }
    
    /* Ensure the search bar and filter items wrap instead of shrinking out of view */
    #div-explorer .header-actions {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    #div-explorer .header-actions > div,
    #div-explorer .header-actions .search-box {
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    #div-explorer-search {
        width: 100% !important;
    }
    #div-explorer-sector, #div-explorer-fy {
        flex: 1 !important;
        width: auto !important;
    }
    
    /* Ensure performance log notes fit the screen */
    #performance-tbody td[data-label="Notes"] {
        align-items: stretch !important;
        flex-direction: column !important;
        grid-column: 1 / -1 !important; /* Force full width on mobile if it's a grid */
    }
    #performance-tbody td[data-label="Notes"] .editable-input {
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
        white-space: normal;
    }
}

/* ═══════════════════════════════════════════════════
   Dividends table — mobile grid overrides
   Inherits Holdings card layout (position, labels, delete button)
   Only overrides the column/row order for Dividends-specific fields:
     Row 1: Symbol (full width) + ACTION delete (absolute top-right)
     Row 2: Record Date (full width)
     Row 3: Payment Date (full width)
     Row 4: DPS | Shares (2 cols)
     Row 5: Gross | Net  (2 cols)
════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Row 1: Symbol (1) is auto handled by general table css, Action (10) auto top right */
    
    /* Row 2: Announcement (3) full width */
    #dividends .data-table td:nth-child(3) {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        align-items: stretch !important;
    }

    /* Row 3: Payment Date (4) full width */
    #dividends .data-table td:nth-child(4) {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        align-items: stretch !important;
    }

    /* Row 4: Type (2) left, DPS (5) right */
    #dividends .data-table td:nth-child(2) {
        grid-column: 1 / 2 !important;
        grid-row: 4 !important;
    }
    #dividends .data-table td:nth-child(5) {
        grid-column: 2 / 3 !important;
        grid-row: 4 !important;
    }

    /* Row 5: Shares Held (6) left, Conversion Price (9) right */
    #dividends .data-table td:nth-child(6) {
        grid-column: 1 / 2 !important;
        grid-row: 5 !important;
    }
    #dividends .data-table td:nth-child(9) {
        grid-column: 2 / 3 !important;
        grid-row: 5 !important;
    }

    /* Row 6: Gross (7) left, Net (8) right */
    #dividends .data-table td:nth-child(7) {
        grid-column: 1 / 2 !important;
        grid-row: 6 !important;
    }
    #dividends .data-table td:nth-child(8) {
        grid-column: 2 / 3 !important;
        grid-row: 6 !important;
    }
    
    /* Ensure primary inputs stretch fully in their containers */
    #dividends .data-table td .editable-input {
        width: 100% !important;
        max-width: none !important;
    }

    /* Safari iPhone fix: date inputs overflow the card */
    #dividends .data-table td:nth-child(3),
    #dividends .data-table td:nth-child(4) {
        overflow: hidden !important;
        min-width: 0 !important;
    }
    #dividends .data-table td:nth-child(3) .editable-input,
    #dividends .data-table td:nth-child(4) .editable-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        font-size: 13px !important;
        padding: 8px 6px !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
}

.brokerage-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--accent-green);
    font-weight: 600;
    font-size: 14px;
}

.brokerage-badge input.editable-badge-input {
    background: transparent;
    border: none;
    color: inherit;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    width: 50px;
    text-align: center;
    border-bottom: 1px dashed rgba(46, 204, 113, 0.6);
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.brokerage-badge input.editable-badge-input:focus {
    border-bottom-color: var(--accent-green);
}

.editable-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 8px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    min-width: 80px;
    outline: none;
    transition: border-color 0.2s;
}

/* Fix native dropdown option visibility in dark mode - Darken to match theme */
.editable-input option {
    background-color: #0f111a;
    color: #f1f5f9;
}

/* Chrome uses the select element's own bg for the dropdown popup */


body.light-theme .editable-input {
    background: rgba(0, 0, 0, 0.03);
    color: #1a1d27;
}

body.light-theme select.editable-input {
    background-color: #ffffff;
    color: #1a1d27;
}

body.light-theme .editable-input option {
    background-color: #ffffff;
    color: #1a1d27;
}

.editable-input:focus {
    border-color: var(--accent-green);
}

.editable-select {
    appearance: none;
    padding-right: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%238b92a5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    line-height: 1;
}

.btn-delete:hover {
    color: var(--accent-red);
    background: rgba(255, 71, 87, 0.1);
}

.table-header-flex .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle Switch */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: .4s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--accent-green);
  transition: .4s;
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

body.light-theme .slider:before {
    background-color: #f39c12; /* Sun orange for light mode */
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.4);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Sidebar Bottom Nav */
.sidebar {
    display: flex;
    flex-direction: column;
}
.sidebar-nav {
    flex: 1;
}
.sidebar-bottom {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* AI Chat Bubbles */
.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-purple));
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
    align-self: flex-start;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}
.chat-bubble.ai.thinking {
    color: var(--text-muted);
    font-style: italic;
}

/* ── Self Learn Tab ── */
.learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.learn-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.learn-card-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.learn-formula {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-left: 3px solid var(--accent-green);
    padding: 10px 14px;
    border-radius: 6px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.learn-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
    flex-grow: 1; /* Pushes the example box to the bottom of the card */
}

.learn-example {
    font-size: 13px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-left: 3px solid #10b981;
    padding: 10px 14px;
    border-radius: 6px;
    line-height: 1.6;
    color: var(--text-muted);
}

.learn-ex-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #10b981;
    display: block;
    margin-bottom: 4px;
}

/* Tags */
.learn-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid rgba(46, 204, 113, 0.3);
}
.learn-tag-green {
    background: rgba(39, 174, 96, 0.12);
    color: var(--accent-green);
    border-color: rgba(39, 174, 96, 0.3);
}
.learn-tag-yellow {
    background: rgba(39, 174, 96, 0.08);
    color: var(--accent-green);
    border-color: rgba(39, 174, 96, 0.2);
}
.learn-tag-red {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.learn-tag-blue {
    color: var(--accent-green);
    border-color: rgba(39, 174, 96, 0.3);
}
.learn-tag-purple {
    background: rgba(155, 81, 224, 0.12);
    color: #c084fc;
    border-color: rgba(155, 81, 224, 0.3);
}

@media (max-width: 768px) {
    .learn-grid {
        grid-template-columns: 1fr;
    }
}
/* ==========================================================================
   CSE Analyser EXACT Image Match Styles
   ========================================================================== */
.analyzer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.analyzer-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

body.dark-theme .analyzer-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    box-shadow: none;
}

.panel-header {
    margin-bottom: 24px;
}

.panel-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

body.dark-theme .panel-title { color: #f9fafb; }

.panel-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

body.dark-theme .panel-subtitle { color: #9ca3af; }

.analyzer-input-group {
    margin-bottom: 20px;
}

.analyzer-input-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.dark-theme .analyzer-input-group label { color: #9ca3af; }

.lbl-small {
    text-transform: none;
    font-weight: 500;
    color: #9ca3af;
}

.select-wrapper {
    position: relative;
}

.select-wrapper i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    font-size: 12px;
}

.img-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    color: #111827;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-weight: 500;
}

.img-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

body.dark-theme .img-input {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f9fafb;
}

body.dark-theme .img-input:focus {
    border-color: var(--accent-green);
}

.img-primary-btn {
    width: 100%;
    background: var(--accent-green);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.img-primary-btn:hover {
    background: #27ae60;
    transform: translateY(-1px);
}

.analyzer-hr {
    border: 0;
    height: 1px;
    background: #f3f4f6;
    margin: 24px 0;
}
body.dark-theme .analyzer-hr { background: rgba(255,255,255,0.05); }

/* Ratios Column */
.img-ratio-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.img-metric-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 14px 16px;
}

body.dark-theme .img-metric-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.img-metric-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.02em;
}

body.dark-theme .img-metric-label { color: #9ca3af; }

.img-metric-value {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    font-family: 'JetBrains Mono', monospace;
}

body.dark-theme .img-metric-value { color: #f9fafb; }

.metric-icon {
    font-size: 18px;
    color: #9ca3af;
}

/* Val Cards in Ratios Column */
.img-val-card {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

body.dark-theme .img-val-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.val-icon {
    font-size: 20px;
    margin-bottom: 12px;
}

.val-label {
    font-size: 10px;
    font-weight: 800;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
body.dark-theme .val-label { color: #9ca3af; }

.val-number {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
}
body.dark-theme .val-number { color: #f9fafb; }

.img-status-badge {
    width: 100%;
    text-align: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-top: 16px;
    background: #ffffff;
}

body.dark-theme .img-status-badge {
    background: transparent;
    border-color: var(--border-glass);
    color: #d1d5db;
}

/* Decision Column */
.img-decision-box {
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #ffffff;
    transition: all 0.3s;
}

body.dark-theme .img-decision-box {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.1);
}

.decision-spinner {
    width: 32px;
    height: 32px;
    background: #9ca3af;
    border-radius: 50%;
    margin-bottom: 20px;
}

.img-decision-text {
    font-size: 36px;
    font-weight: 900;
    color: #111827;
    margin: 0 0 12px 0;
    letter-spacing: -0.03em;
}

body.dark-theme .img-decision-text { color: #f9fafb; }

.img-decision-reason {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}
body.dark-theme .img-decision-reason { color: #9ca3af; }

.img-decision-box.buy-state {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.05);
}
.img-decision-box.buy-state .decision-spinner { background: #34d399; }
.img-decision-box.buy-state .img-decision-text { color: #059669; }

.img-decision-box.hold-state {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}
.img-decision-box.hold-state .decision-spinner { background: #fbbf24; }
.img-decision-box.hold-state .img-decision-text { color: #d97706; }

.img-decision-box.sell-state {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}
.img-decision-box.sell-state .decision-spinner { background: #ef4444; }
.img-decision-box.sell-state .img-decision-text { color: #dc2626; }


.img-rules-log {
    background: #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

body.dark-theme .img-rules-log {
    background: rgba(255,255,255,0.05);
}

.img-rules-log h4 {
    font-size: 12px;
    font-weight: 800;
    color: #374151;
    margin: 0 0 16px 0;
    letter-spacing: 0.02em;
}

body.dark-theme .img-rules-log h4 { color: #d1d5db; }

.img-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.img-rules-list li {
    font-size: 13px;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 10px;
}
body.dark-theme .img-rules-list li { color: #9ca3af; }

.img-rules-list li i {
    font-size: 14px;
}
.img-rules-list li.pass i { color: #10b981; }
.img-rules-list li.fail i { color: #ef4444; }

.img-disclaimer {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding: 16px;
    background: #ffffff;
    border-left: 3px solid #6b7280;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

body.dark-theme .img-disclaimer {
    background: transparent;
    border-left-color: var(--border-glass);
    color: #9ca3af;
}

.ai-quick-actions {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}
.ai-quick-actions::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.ai-quick-pill {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: var(--accent-green);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

body.dark-theme .ai-quick-pill {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.3);
    color: #4ade80;
}

.ai-quick-pill:hover {
    background: rgba(46, 204, 113, 0.2);
    transform: translateY(-1px);
}

body.dark-theme .ai-quick-pill:hover {
    background: rgba(46, 204, 113, 0.3);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.month-card {
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 18px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    position: relative;
    overflow: hidden;
}

.month-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: rgba(46, 204, 113, 0.1);
    transition: all 0.3s ease;
}

.month-card.has-dividends {
    border-color: rgba(39, 174, 96, 0.4);
    background: linear-gradient(145deg, rgba(39, 174, 96, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(39, 174, 96, 0.05);
}

.month-card.has-dividends::before {
    background: linear-gradient(to bottom, #27ae60, #c7ff00);
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

.month-card.current-month {
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(251, 191, 36, 0.03);
}

.month-card.current-month::after {
    content: 'CURRENT';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 8px;
    font-weight: 800;
    color: #fbbf24;
    padding: 2px 6px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 4px;
    letter-spacing: 1px;
}

.month-card:hover {
    transform: translateY(-5px);
    border-color: rgba(46, 204, 113, 0.4);
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 10px;
}

.month-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.month-total {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-green);
}

.month-stock-list {
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0;
}

.month-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.month-stock-symbol {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.month-stock-amount {
    font-family: 'Monaco', 'Consolas', monospace;
}

.empty-month-msg {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
    margin-top: 10px;
}



/* Technical Signals Grid (v47 CSE Tracker Match) */
.ta-signals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ta-signal-panel {
    padding: 16px;
    border-radius: 8px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    min-width: 0;
}

body.light-theme .ta-signal-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body.light-theme .ta-panel-header {
    color: #1e293b;
    font-weight: 700;
}

.ta-signal-panel canvas {
    max-height: 220px !important;
}

.ta-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.ta-panel-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ta-panel-question {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

body.dark-theme .ta-panel-question {
    border-color: rgba(255,255,255,0.1);
}

.ta-period-btns {
    display: flex;
    background: var(--bg-body);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    padding: 3px;
    gap: 2px;
}

body.light-theme .ta-period-btns {
    background: #f8fafc;
    border-color: #e2e8f0;
}



.ta-search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
    font-size: 13px;
}

.ta-search-result-item:hover { background: rgba(255,255,255,0.08); }


@media (max-width: 900px) {
    .ta-signals-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
    .analyzer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Desktop Grid for Sector Insights */
@media (min-width: 992px) {
    .sector-insights-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        flex-direction: row !important; /* Override flex column */
        flex-wrap: wrap !important;
    }
}

/* Self Learn Accordion System */
.sl-accordion-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 20px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-bottom: 0 !important;
}

.sl-accordion-header:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.sl-accordion-header h3 {
    font-size: 15px !important;
    margin: 0 !important;
}

.sl-accordion-content {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.4s ease-out, padding 0.3s ease !important;
    padding: 0 10px !important;
    opacity: 0 !important;
}

.sl-accordion-item.active .sl-accordion-content {
    max-height: 8000px !important;
    padding: 20px 10px !important;
    opacity: 1 !important;
}

.sl-chevron {
    transition: transform 0.3s ease !important;
    color: var(--text-muted);
}

.sl-accordion-item.active .sl-chevron {
    transform: rotate(180deg) !important;
}





/* Base Sector Insights Restructure */
.top-exposure-card {
    background: rgba(29, 30, 37, 0.45);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}
body.light-theme .top-exposure-card {
    background: rgba(225, 225, 225, 0.45);
    border-color: rgba(0,0,0,0.05);
}
.te-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.te-label {
    font-size: 11px;
    color: #8b92a5;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.te-badge {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}
.te-title {
    font-size: 24px;
    color: #fff;
    font-weight: 600;
    margin-bottom: 24px;
}
body.light-theme .te-title {
    color: inherit;
}
.te-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 60px;
}
.te-bar {
    flex: 1;
    background: #20232b;
    border-radius: 4px 4px 0 0;
    min-height: 10%;
    transition: 0.3s;
}
body.light-theme .te-bar {
    background: #dadada;
}
.te-bar.active {
    background: var(--accent-green);
}
body.light-theme .te-bar.active {
    background: var(--accent-green);
}

.sector-insight-card {
    background: #1e1f23;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255,255,255,0.03);
}
body.light-theme .sector-insight-card {
    background: #dadada;
    border-color: rgba(0,0,0,0.02);
}
.si-icon-box {
    width: 48px;
    height: 48px;
    background: #171718;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-green);
    font-size: 20px;
    flex-shrink: 0;
}
body.light-theme .si-icon-box {
    background: #eee;
}
.si-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.si-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.si-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}
body.light-theme .si-name {
    color: inherit;
}
.si-pct {
    font-size: 12px;
    color: #2ecc71;
    font-weight: 500;
}
.si-lbl {
    font-size: 12px;
    color: #8b92a5;
}
.si-val {
    font-size: 13px;
    color: #e2e8f0;
    font-weight: 600;
}
body.light-theme .si-val {
    color: #1a1d27;
}

@media (max-width: 768px) {
    .analyzer-grid {
        grid-template-columns: 1fr;
    }

    /* Fix Sidebar & Main Content for Mobile */
    .sidebar {
        transform: translateX(-110%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        position: fixed !important;
        z-index: 10000;
        height: 100vh;
        width: 260px;
        top: 0;
        left: 0;
        border-radius: 0 16px 16px 0;
        border: none;
        box-shadow: 10px 0 30px rgba(0,0,0,0.6);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    /* Main Content takes full width */
    .main-content {
        margin-left: 0 !important;
        padding: 16px 16px 80px 16px !important; 
    }

    /* Top Header */
    .top-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 16px;
    }

    .top-header h1 {
        font-size: 18px !important;
        padding-top: 14px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Show Mobile Menu Button */
    #mobile-menu-btn {
        display: block !important;
    }

    /* Ensure structural grids stack */
    .kpi-grid, .top-panels-grid, .ta-signals-grid, .charts-grid {
        grid-template-columns: 1fr !important;
    }

    /* Mobile Card Layout for Tables */
    .table-container {
        overflow-x: hidden !important;
        padding: 0 8px 16px 8px !important;
        width: 100%;
        background: transparent !important;
        box-shadow: none !important;
    }
    
    .data-table thead {
        display: none !important;
    }

    .data-table, .data-table tbody, .data-table tr, .data-table td {
        display: block !important;
        width: 100% !important;
    }

    .data-table tr {
        background: var(--bg-glass) !important;
        border-radius: 16px !important;
        margin-bottom: 20px !important;
        padding: 20px 16px !important;
        border: 1px solid var(--border-glass) !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 16px 12px;
        position: relative;
    }

    /* Action Button (Delete) Floating Top Right */
    .data-table td:last-child {
        position: absolute;
        top: 20px;
        right: 16px;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
    }

    .data-table td {
        padding: 0 !important;
        border: none !important;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        font-size: 15px !important;
        color: var(--text-main);
        white-space: normal !important;
    }

    .data-table td::before {
        content: attr(data-label);
        font-size: 10px !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        margin-bottom: 6px;
        font-weight: 600;
        display: block;
    }

    .editable-input, .editable-badge-input {
        padding: 8px 12px !important;
        font-size: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }

    /* Force the Symbol/Identifier to span the whole row at the top */
    .data-table td[data-label="Symbol"], .data-table td[data-label="Stock Symbol"] {
        grid-column: 1 / -1;
        font-size: 18px !important;
        margin-bottom: 4px;
    }

    /* Highlight Total Value prominently */
    .data-table td[data-label="Total Value"], .data-table td[data-label="Market Value"] {
        font-size: 18px !important;
        font-weight: 700 !important;
    }

    .btn-delete {
        width: 28px !important;
        height: 28px !important;
        font-size: 18px !important;
    }
}

/* -------------------------------------
   MODERN CASH FLOW DASHBOARD STYLES
--------------------------------------- */
.cash-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    margin-top: 10px;
}

/* Grid Area Assignments */
.cf-hero-panel { grid-column: 1 / 2; grid-row: 1 / 2; display: flex; flex-direction: column; padding: 24px !important; }
.cf-kpi-stack { grid-column: 2 / 3; grid-row: 1 / 2; display: flex; flex-direction: column; gap: 20px; }
.cf-breakdown-panel { grid-column: 1 / 3; grid-row: 2 / 3; padding: 24px !important; }
.cf-forecast-panel { grid-column: 1 / 2; grid-row: 3 / 4; display: flex; flex-direction: column; justify-content: center; padding: 24px !important; }
.cf-allocation-panel { grid-column: 2 / 3; grid-row: 3 / 4; display: flex; flex-direction: column; justify-content: center; padding: 24px !important; }

@media (max-width: 1024px) {
    .cash-dashboard-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto auto auto !important;
    }
    .cf-hero-panel { grid-column: 1 / 2; grid-row: 1 / 2; }
    .cf-kpi-stack { grid-column: 1 / 2; grid-row: 2 / 3; flex-direction: row; flex-wrap: wrap; }
    .cf-breakdown-panel { grid-column: 1 / 2; grid-row: 3 / 4; }
    .cf-forecast-panel { grid-column: 1 / 2; grid-row: 4 / 5; }
    .cf-allocation-panel { grid-column: 1 / 2; grid-row: 5 / 6; }
}

/* Header & Panels */
.cf-panel-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .cf-panel-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px;
    }
}

/* Hero Panel */
.cf-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.cf-subtitle {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 0 0 6px 0;
}
.cf-balance-huge {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

/* KPI Cards */
.cf-kpi-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}
.cf-kpi-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-main);
}
.cf-kpi-value {
    font-size: 24px;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}
.cf-kpi-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
    font-style: italic;
}

/* Progress Bar in KPI */
.cf-progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--surface-hover);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}
.cf-progress-bar {
    height: 100%;
    background: var(--accent-green);
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Transaction Table Pills */
.status-pill {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
}
.status-completed { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.status-settled { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-automated { background: rgba(107, 114, 128, 0.15); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }
.status-verified { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Table Icons */
.cat-icon-container {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}



.cf-cat-flex {
    display: flex;
    align-items: center;
    font-weight: 600;
}

/* Mobile Breakpoints */
@media (max-width: 1024px) {
    .cash-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .cf-hero-panel { grid-column: 1 / 2; grid-row: 1 / 2; }
    .cf-kpi-stack { 
        grid-column: 1 / 2; 
        grid-row: 2 / 3; 
        flex-direction: row; 
    }
    .cf-breakdown-panel { grid-column: 1 / 2; grid-row: 3 / 4; }
    .cf-forecast-panel { grid-column: 1 / 2; grid-row: 4 / 5; }
    .cf-allocation-panel { grid-column: 1 / 2; grid-row: 5 / 6; }
}

@media (max-width: 768px) {
    .cf-kpi-stack {
        flex-direction: column !important;
    }
    .cf-hero-panel, .cf-breakdown-panel, .cf-forecast-panel, .cf-allocation-panel, .cf-kpi-card {
        padding: 20px !important;
    }
    .cf-balance-huge {
        font-size: 24px !important;
    }
    .cf-allocation-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .cf-panel-header {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        margin-bottom: 24px !important;
        align-items: stretch !important;
    }
    .cf-actions {
        width: 100% !important;
        display: block !important;
    }
    .cf-actions .btn {
        width: 100% !important;
        display: block !important;
        padding: 14px !important;
        font-size: 14px !important;
        text-align: center !important;
    }
    .cf-hero-header {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: flex-start !important;
    }
}


/* -------------------------------------------
   HISTORICAL LOG REDESIGN STYLES
------------------------------------------- */
.hist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.hist-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hist-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hist-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.hist-input-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.hist-params-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hist-btns-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.hist-btns-row .btn {
    flex: 1;
}

.btn-fetch {
    background: #030712;
    color: #fff;
    border: none;
}
.btn-fetch:hover {
    background: #23262b;
}

.hist-table-card {
    padding: 0 !important;
    overflow: hidden;
}

@media (min-width: 769px) {
    #hist-jump-date {
        text-align: right;
    }
}

@media (max-width: 768px) {
    #hist-market-logs-card.empty-state {
        display: none !important;
    }
}

/* Historical Performance Chart */
.hist-chart-panel {
    padding: 20px 24px 16px;
}

.hist-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.hist-chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.hist-chart-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.hist-period-btns {
    display: flex;
    gap: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 4px;
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.period-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-main);
}

.period-btn.active {
    background: var(--accent-green);
    color: #000;
    box-shadow: 0 2px 10px rgba(0, 210, 255, 0.35);
}

body.light-theme .period-btn.active {
    color: #fff;
    background: var(--accent-green);
    box-shadow: 0 2px 10px rgba(58,134,255,0.35);
}

.hist-table-header {
    background: rgba(29, 30, 37, 0.45);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Light Theme Override */
body.light-theme .hist-table-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .hist-header-info h3 {
    color: #1e293b;
}

.hist-header-info h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.hist-meta {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 204, 113, 0.1);
    color: var(--accent-green);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--accent-green);
}

.change-badge {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

.change-badge.positive {
    background: rgba(46, 204, 113, 0.2);
    color: var(--accent-green);
}

.change-badge.negative {
    background: rgba(255, 71, 87, 0.2);
    color: var(--accent-red);
}

.hist-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-glass);
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.pagination-btns {
    display: flex;
    gap: 8px;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    background: var(--bg-glass);
    color: var(--text-main);
}

.page-btn.active {
    background: #030712;
    color: #fff;
    border-color: #030712;
}

@media (max-width: 768px) {
    .hist-grid {
        grid-template-columns: 1fr;
    }
    .hist-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .hist-footer {
        flex-direction: column;
        gap: 16px;
    }
}

/* ── Historical Log: Stats Summary Bar ── */
.hist-stat-item {
    flex: 1;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 20px;
}

.hist-stat-item:first-child {
    padding-left: 0;
}

.hist-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hist-stat-value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hist-stat-divider {
    width: 1px;
    background: var(--border-glass);
    align-self: stretch;
    margin: 2px 0;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    #hist-stats-bar > div {
        flex-wrap: wrap;
        gap: 0 !important;
    }
    .hist-stat-item {
        min-width: calc(50% - 1px);
        padding: 12px 10px;
        border-bottom: 1px solid var(--border-glass);
    }
    .hist-stat-item:first-child {
        padding-left: 10px;
    }
    .hist-stat-divider {
        display: none;
    }
}

/* ── Historical Log: Jump to Date Styling ── */
#hist-jump-date {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color-scheme: dark; /* Ensures native date picker is dark */
    cursor: pointer;
    transition: all 0.2s ease;
}

#hist-jump-date:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

#hist-jump-date:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.1);
}

body.light-theme #hist-jump-date {
    background: #fff;
    color: #1a1d27;
    color-scheme: light;
}

/* -------------------------------------------
   PRO & ADMIN ECOSYSTEM STYLES
------------------------------------------- */

/* achievement badges */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
}
.badge-admin { background: rgba(39, 174, 96, 0.15); color: var(--accent-green); border: 1px solid rgba(39, 174, 96, 0.3); }
.badge-pro { background: rgba(39, 174, 96, 0.15); color: var(--accent-green); border: 1px solid rgba(39, 174, 96, 0.3); }
.badge-free { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--border-glass); }

/* Pro Lock Overlay (Diamond Glass) */
.pro-lock-vault {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(19, 19, 22) !important;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

body.light-theme .pro-lock-vault {
    background: rgb(236, 236, 236) !important;
}

.pro-lock-content {
    background: rgb(30, 31, 35) !important;
    border: 1px solid rgba(39, 174, 96, 0.3) !important;
    padding: 40px;
    border-radius: 24px;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

body.light-theme .pro-lock-content {
    background: #fff !important;
    border-color: rgba(39, 174, 96, 0.3) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .pro-lock-content h2 {
    color: #1e1f23;
}

body.light-theme .pro-perks-list,
body.light-theme .pro-perks-list span {
    color: #8e9297;
}

.diamond-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 10px 20px rgba(39, 174, 96, 0.3);
    animation: float 3s ease-in-out infinite;
}

.pro-lock-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.pro-lock-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.pro-perks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    margin-bottom: 30px;
}

.pro-perks-list span {
    font-size: 13px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pro-perks-list i {
    color: var(--accent-green);
}

/* Locked Tab & Section States (v92.22) */
.pro-locked {
    position: relative !important;
    filter: saturate(0.15) opacity(0.5) !important;
    user-select: none !important;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Invisible overlay to catch hover events for the tooltip */
.pro-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    cursor: not-allowed;
    background: transparent;
}

/* Override: overlay inside locked container must remain clickable */
.pro-locked > .pro-lock-vault {
    pointer-events: auto !important;
    filter: none !important;
    opacity: 1 !important;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgb(23, 24, 29);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    padding: 12px 24px;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    gap: 6px;
    padding: 4px 20px;
}

.hist-stat-item:first-child {
    padding-left: 0;
}

.hist-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hist-stat-value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hist-stat-divider {
    width: 1px;
    background: var(--border-glass);
    align-self: stretch;
    margin: 2px 0;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    #hist-stats-bar > div {
        flex-wrap: wrap;
        gap: 0 !important;
    }
    .hist-stat-item {
        min-width: calc(50% - 1px);
        padding: 12px 10px;
        border-bottom: 1px solid var(--border-glass);
    }
    .hist-stat-item:first-child {
        padding-left: 10px;
    }
    .hist-stat-divider {
        display: none;
    }
}

/* ── Historical Log: Jump to Date Styling ── */
#hist-jump-date {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color-scheme: dark; /* Ensures native date picker is dark */
    cursor: pointer;
    transition: all 0.2s ease;
}

#hist-jump-date:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

#hist-jump-date:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.1);
}

body.light-theme #hist-jump-date {
    background: #fff;
    color: #1a1d27;
    color-scheme: light;
}

/* -------------------------------------------
   PRO & ADMIN ECOSYSTEM STYLES
------------------------------------------- */

/* achievement badges */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
}
.badge-admin { background: rgba(39, 174, 96, 0.15); color: var(--accent-green); border: 1px solid rgba(39, 174, 96, 0.3); }
.badge-pro { background: rgba(39, 174, 96, 0.15); color: var(--accent-green); border: 1px solid rgba(39, 174, 96, 0.3); }
.badge-free { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--border-glass); }

/* Pro Lock Overlay (Diamond Glass) — cascade duplicate */
.pro-lock-vault {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(19, 19, 22) !important;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

.pro-lock-content {
    background: rgb(30, 31, 35) !important;
    border: 1px solid rgba(39, 174, 96, 0.3) !important;
    padding: 40px;
    border-radius: 24px;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.diamond-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 10px 20px rgba(39, 174, 96, 0.3);
    animation: float 3s ease-in-out infinite;
}

.pro-lock-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.pro-lock-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.pro-perks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    margin-bottom: 30px;
}

.pro-perks-list span {
    font-size: 13px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pro-perks-list i {
    color: var(--accent-green);
}

/* Locked Tab & Section States (cascade duplicate) */
.pro-locked {
    position: relative !important;
    filter: saturate(0.15) opacity(0.5) !important;
    user-select: none !important;
}

.pro-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    cursor: not-allowed;
    background: transparent;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgb(23, 24, 29);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    padding: 12px 24px;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99999;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-success { color: #10b981; border-color: rgba(16, 185, 129, 0.4); }
.toast-error { color: #ef4444; border-color: rgba(239, 68, 68, 0.4); }
.toast-info { color: #2ecc71; border-color: rgba(34, 197, 94, 0.4); }

/* Buttons & Gradients */
.gold-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
    color: #fff !important;
    font-weight: 800 !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2) !important;
    transition: all 0.2s ease !important;
}

.gold-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3) !important;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
}

.status-dot {
    display: block;
    width: 7px;
    height: 7px;
    min-width: 7px;
    min-height: 7px;
    background-color: #2ecc71;
    border-radius: 50%;
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0% { transform: scale(1); opacity: 0.6; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px rgba(46, 204, 113, 1); }
    100% { transform: scale(1); opacity: 0.6; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.modal-content h4 {
    border-left: 3px solid var(--accent-green);
    padding-left: 12px;
}

.modal-content p {
    font-size: 14px;
    margin-top: 8px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content.glass-panel {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: modalFadeIn 0.3s ease-out;
}

@media (max-width: 768px) {
    .modal-content.glass-panel {
        padding: 24px;
        margin: 20px auto;
    }
}

.btn-primary {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--font-stack);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

body.light-theme .app-footer {
    background: rgba(248, 249, 250, 0.95) !important;
    border-top-color: rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(10px) !important;
}

body.light-theme .modal-overlay {
    background: rgba(0, 0, 0, 0.5) !important;
}

body.light-theme .modal-content.glass-panel {
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .modal-content h4 {
    color: #1a1d27 !important;
}

body.light-theme .modal-content p {
    color: #5c677d !important;
}

body.light-theme .modal-content h2 {
    color: var(--accent-green) !important;
}

body.light-theme .modal-close {
    color: #9ca3af !important;
}

body.light-theme .modal-close:hover {
    color: #1a1d27 !important;
}

/* Base Responsive Grids */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 24px;
    padding-top: 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

@media (max-width: 992px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Admin Desktop / Mobile Toggle --- */
.admin-desktop-only {
    display: block !important;
}

.admin-mobile-only {
    display: none !important;
}

@media (max-width: 992px) {
    .admin-desktop-only {
        display: none !important;
    }
    .admin-mobile-only {
        display: block !important;
    }
    .admin-user-cards-grid.admin-mobile-only {
        display: flex !important;
    }
}

/* --- Admin User Registry Cards --- */
.admin-user-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}

.admin-user-cards-grid::-webkit-scrollbar {
    width: 4px;
}

.admin-user-cards-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.admin-user-card {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.admin-user-card:hover {
    border-color: rgba(46, 204, 113, 0.2);
    transform: translateY(-2px);
}

.admin-user-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.admin-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.05));
    border: 2px solid rgba(46, 204, 113, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-user-avatar svg {
    color: var(--accent-green);
    opacity: 0.8;
}

.admin-user-info {
    flex: 1;
    min-width: 0;
}

.admin-user-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-username {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.admin-user-tier-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.admin-user-tier-badge.tier-free {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.admin-user-tier-badge.tier-monthly {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.admin-user-tier-badge.tier-annual {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.admin-user-tier-badge.tier-lifetime,
.admin-user-tier-badge.tier-pro {
    background: rgba(234, 179, 8, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.admin-user-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}

.admin-user-data-cell {
    padding: 10px 14px;
    background: rgba(18, 22, 30, 0.6);
}

.admin-user-data-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.admin-user-data-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-all;
}

.admin-user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
}

.admin-action-btn.action-key {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.admin-action-btn.action-key:hover {
    background: #10b981;
    color: #fff;
}

.admin-action-btn.action-email {
    color: var(--accent-green);
    background: rgba(46, 204, 113, 0.1);
    text-decoration: none;
}

.admin-action-btn.action-email:hover {
    background: var(--accent-green);
    color: #0f172a;
}

.admin-action-btn.action-delete {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.admin-action-btn.action-delete:hover {
    background: #ef4444;
    color: #fff;
}

.admin-user-self-badge {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    height: 36px;
    display: inline-flex;
    align-items: center;
}

/* Light theme overrides */
body.light-theme .admin-user-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme .admin-user-card:hover {
    border-color: rgba(46, 204, 113, 0.4);
}

body.light-theme .admin-user-avatar {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(39, 174, 96, 0.03));
    border-color: rgba(46, 204, 113, 0.3);
}

body.light-theme .admin-user-name {
    color: #1e293b;
}

body.light-theme .admin-user-data-grid {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-theme .admin-user-data-cell {
    background: #ffffff;
}

body.light-theme .admin-user-data-value {
    color: #1e293b;
}

body.light-theme .admin-user-tier-badge.tier-free {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

/* Self Learn - Quick Reference: Light mode overrides */
body.light-theme .sl-ref-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-theme .sl-ref-category {
    color: #64748b;
}

body.light-theme .sl-ref-measure-text {
    color: #334155;
}

body.light-theme .sl-val-box {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-theme .sl-val-text {
    color: #1e293b;
}

body.light-theme .sl-ref-card:hover {
    border-color: rgba(46, 204, 113, 0.4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body.light-theme .sl-ref-tag {
    background: rgba(39, 174, 96, 0.08);
    border-color: rgba(39, 174, 96, 0.3);
}

/* ── Projected Dividend Income Card ── */
.proj-div-card {
    margin-top: 0;
    padding: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(46, 204, 113, 0.15);
}

.proj-div-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.proj-div-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.15), rgba(46, 204, 113, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-green);
    flex-shrink: 0;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.proj-div-title-block h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.proj-div-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
}

.proj-div-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.proj-div-metric {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.proj-div-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}

.proj-div-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: 'Outfit', sans-serif;
}

.proj-div-note {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
}

.proj-div-cagr {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-green);
    background: rgba(46, 204, 113, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
    margin-top: 2px;
}

.proj-div-divider {
    height: 1px;
    background: var(--border-glass);
    margin-bottom: 14px;
}

.proj-div-insights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.proj-div-insight {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    transition: all 0.2s;
}

.proj-div-insight:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.proj-div-insight-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.proj-div-insight-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.proj-div-insight-value {
    font-size: 14px;
    font-weight: 700;
    display: block;
}

/* PRO Lock Overlay (Card-Level) */
.proj-div-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(19, 19, 22, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.proj-div-lock-content {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    padding: 12px 28px;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

/* PRO Lock Overlay for What-If Simulator */
.sim-pro-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(19, 19, 22, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.sim-pro-lock-overlay .proj-div-lock-content {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

body.light-theme .sim-pro-lock-overlay {
    background: rgba(245, 245, 245, 0.7);
}

.proj-div-lock-content i {
    font-size: 16px;
}

/* Light Theme Overrides */
body.light-theme .proj-div-card {
    border-color: rgba(39, 174, 96, 0.12);
}

body.light-theme .proj-div-metric {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .proj-div-insight {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .proj-div-insight:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .proj-div-lock-overlay {
    background: rgba(245, 245, 245, 0.7);
}

/* ═══════════════════════════════════════════════════════════════════ */
/* Strategic Tools Grid — Projected Income + What-If Simulator       */
/* ═══════════════════════════════════════════════════════════════════ */
.dividend-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 28px;
    align-items: stretch;
}

.strategic-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Yield Analytics Row (inside Projected Dividend card) ── */
.proj-div-yield-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.proj-div-yield-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.2s;
}

.proj-div-yield-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.proj-div-yield-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.proj-div-yield-value {
    font-size: 18px;
    font-weight: 800;
    color: #2ecc71;
    font-family: 'Outfit', sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* What-If Simulator Card                                            */
/* ═══════════════════════════════════════════════════════════════════ */
.sim-card {
    display: flex;
    flex-direction: column;
    padding: 28px;
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.sim-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.sim-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(139, 92, 246, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a855f7;
    flex-shrink: 0;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.sim-title-block h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.sim-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
}

/* ── Mode Toggle ── */
.sim-mode-toggle {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.sim-mode-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sim-mode-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.sim-mode-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(139, 92, 246, 0.15));
    color: #c084fc;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.sim-mode-btn i {
    font-size: 12px;
}

/* ── Panels & Inputs ── */
.sim-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sim-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sim-input-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}

.sim-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.sim-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.sim-input:focus {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.06);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

/* ── Symbol Search Dropdown ── */
.sim-search-wrapper {
    position: relative;
}

.sim-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(28, 30, 38, 0.98);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sim-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.sim-dropdown-item:last-child {
    border-bottom: none;
}

.sim-dropdown-item:hover {
    background: rgba(168, 85, 247, 0.1);
    color: #fff;
}

.sim-dropdown-item .sim-dd-symbol {
    font-weight: 700;
    color: #fff;
}

.sim-dropdown-item .sim-dd-price {
    font-size: 12px;
    color: #a855f7;
    font-weight: 600;
}

/* ── Run Button ── */
.sim-run-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.sim-run-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    background: linear-gradient(135deg, #b76ff7, #8b5cf6);
}

.sim-run-btn:active {
    transform: translateY(0);
}

.sim-run-btn-goal {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.sim-run-btn-goal:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* ── Results Area ── */
.sim-results {
    margin-top: 20px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.2);
    animation: simResultsIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes simResultsIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sim-results-header {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(139, 92, 246, 0.06));
    padding: 12px 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: #c084fc;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.sim-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255, 255, 255, 0.03);
}

.sim-result-cell {
    padding: 16px 18px;
    background: rgba(15, 17, 26, 0.6);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sim-result-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}

.sim-result-value {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.sim-result-value.highlight-purple { color: #c084fc; }
.sim-result-value.highlight-green  { color: #2ecc71; }
.sim-result-value.highlight-gold   { color: #fbbf24; }

/* ── Impact Badge ── */
.sim-impact-badge {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), rgba(39, 174, 96, 0.04));
    border-top: 1px solid rgba(46, 204, 113, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #2ecc71;
}

.sim-impact-badge i {
    font-size: 16px;
}

.sim-impact-badge .impact-text {
    flex: 1;
}

.sim-impact-badge .impact-pct {
    font-size: 18px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* Light Theme Overrides for Simulator                               */
/* ═══════════════════════════════════════════════════════════════════ */
body.light-theme .sim-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1a1d27;
}

body.light-theme .sim-input::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

body.light-theme .sim-input:focus {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.04);
}

body.light-theme .sim-mode-toggle {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .sim-mode-btn {
    color: #64748b;
}

body.light-theme .sim-mode-btn:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.04);
}

body.light-theme .sim-mode-btn.active {
    color: #7c3aed;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
}

body.light-theme .sim-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

body.light-theme .sim-dropdown-item {
    color: #475569;
    border-bottom-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .sim-dropdown-item:hover {
    background: rgba(168, 85, 247, 0.06);
    color: #1e293b;
}

body.light-theme .sim-dropdown-item .sim-dd-symbol {
    color: #1e293b;
}

body.light-theme .sim-result-cell {
    background: rgba(255, 255, 255, 0.6);
}

body.light-theme .sim-result-label {
    color: #64748b;
}

body.light-theme .sim-result-value {
    color: #1e293b;
}

body.light-theme .sim-results {
    border-color: rgba(168, 85, 247, 0.15);
}

body.light-theme .sim-results-header {
    background: rgba(168, 85, 247, 0.06);
    border-bottom-color: rgba(168, 85, 247, 0.1);
}

body.light-theme .sim-impact-badge {
    background: rgba(46, 204, 113, 0.06);
    border-top-color: rgba(46, 204, 113, 0.12);
}

body.light-theme .proj-div-yield-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .proj-div-yield-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ═══════════════════════════════════════════════════════════════════ */
/* Responsive — Strategic Tools                                      */
/* ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .dividend-tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .proj-div-card { padding: 20px; }
    .proj-div-grid { grid-template-columns: 1fr; gap: 14px; }
    .proj-div-insights { grid-template-columns: 1fr; gap: 12px; }
    .proj-div-value { font-size: 22px; }
    .proj-div-yield-row { flex-direction: column; gap: 10px; }
    .sim-results-grid { grid-template-columns: 1fr; }
    .sim-card { padding: 20px; }
}

/* Watchlist & Alerts */
.badge-triggered { animation: pulse-red 2s infinite; }
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
