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

/* --- DESIGN SYSTEM & CSS VARIABLES --- */
:root {
    --bg-main: #060713;
    --bg-gradient: radial-gradient(circle at 50% 0%, #15133c 0%, #060713 70%);
    --panel-bg: rgba(13, 14, 33, 0.45);
    --panel-border: rgba(255, 255, 255, 0.07);
    --panel-hover: rgba(255, 255, 255, 0.1);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --color-cyan: #00f2fe;
    --color-indigo: #4facfe;
    --color-emerald: #05df72;
    --color-rose: #ff4a5a;
    --color-amber: #f5a623;
    
    /* Portal Badges Colors */
    --portal-screener: #0284c7;
    --portal-tickertape: #10b981;
    --portal-moneycontrol: #4f46e5;
    --portal-chartink: #f97316;
    --portal-nse: #b91c1c;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --shadow-glow: 0 8px 32px 0 rgba(0, 242, 254, 0.15);
    --shadow-panel: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & GENERAL STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
    background: var(--bg-main);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- LAYOUT STRUCTURE --- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
aside {
    background: rgba(8, 9, 25, 0.7);
    border-right: 1px solid var(--panel-border);
    backdrop-filter: blur(20px);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 10;
    overflow-y: auto;
}

aside::-webkit-scrollbar {
    width: 6px;
}
aside::-webkit-scrollbar-track {
    background: transparent;
}
aside::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
aside::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-indigo));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-badge {
    background: rgba(0, 242, 254, 0.1);
    color: var(--color-cyan);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    margin-left: auto;
}

.scanner-logo-svg path {
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.6));
    will-change: filter;
}

.scanner-logo-svg line,
.scanner-logo-svg rect {
    filter: drop-shadow(0 0 2px rgba(0, 240, 255, 0.4));
    will-change: filter;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: var(--panel-hover);
}

.nav-item.active {
    background: rgba(0, 242, 254, 0.08);
    border-left: 3px solid var(--color-cyan);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--panel-border);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- MAIN CONTENT --- */
main {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Header Dashboard Bar */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.welcome-section h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Market Indices Bar */
.market-indices {
    display: flex;
    gap: 1rem;
}

.index-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    backdrop-filter: blur(16px);
}

.index-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.index-val {
    font-weight: 700;
}

.index-change {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.index-change.positive {
    color: var(--color-emerald);
}

.index-change.negative {
    color: var(--color-rose);
}

/* --- GLASSMORPHIC PANELS --- */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid rgba(0, 240, 255, 0.15); /* Precise sub-pixel grid border */
    border-radius: 10px; /* Sharper cyberpunk corners */
    padding: 1.25rem; /* Tighter padding for high density */
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-panel);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* --- MONTHLY SCAN SECTION --- */
.monthly-scan-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
}

.scan-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(0, 242, 254, 0.05), transparent 60%), var(--panel-bg);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.scan-radar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(0, 242, 254, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-radar-circle {
    position: absolute;
    width: 90%;
    height: 90%;
    border: 1px dashed rgba(0, 242, 254, 0.3);
    border-radius: 50%;
}

.scan-radar-core {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.5);
    z-index: 2;
}

.scan-radar-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(0, 242, 254, 0.35) 0deg, transparent 90deg, transparent 360deg);
    animation: radar-sweep 2s linear infinite;
    animation-play-state: paused;
    z-index: 1;
    pointer-events: none;
}

.scanning .scan-radar-sweep {
    animation-play-state: running;
}

.scan-button {
    background: linear-gradient(90deg, var(--color-cyan), var(--color-indigo));
    border: none;
    outline: none;
    color: #060713;
    padding: 0.85rem 2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.scan-button:hover {
    box-shadow: 0 4px 30px rgba(0, 242, 254, 0.5);
    transform: translateY(-2px);
}

.scan-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Display Area */
.scan-results-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
    position: relative;
}

.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    gap: 0.75rem;
}

.results-placeholder svg {
    color: var(--text-muted);
    opacity: 0.3;
}

.scanning-visuals {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.scanning-bar {
    width: 250px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.scanning-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-indigo));
    width: 0%;
    animation: bar-grow 2.5s cubic-bezier(0.1, 0.85, 0.25, 1) forwards;
}

.scanning-log {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--color-cyan);
    height: 20px;
}

/* Top 2 Stocks Layout */
.top-stocks-grid {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeInUp 0.5s ease-out;
}

.top-stock-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.top-stock-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.4), transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.top-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stock-badge {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 172, 254, 0.1));
    border: 1px solid rgba(0, 242, 254, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-cyan);
}

.rank-badge {
    background: var(--color-cyan);
    color: #060713;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stock-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stock-name-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stock-symbol {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stock-fullname {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stock-price-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stock-price {
    font-size: 1.2rem;
    font-weight: 700;
}

.stock-change {
    font-size: 0.85rem;
    font-weight: 600;
}

.score-rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid var(--panel-border);
    border-bottom: 1px solid var(--panel-border);
}

.metric-circle-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-score-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.metric-score-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-cyan);
}

.recommendation-rating {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.rating-strongbuy {
    background: rgba(5, 223, 114, 0.15);
    color: var(--color-emerald);
    border: 1px solid rgba(5, 223, 114, 0.25);
}

.rating-buy {
    background: rgba(79, 172, 254, 0.15);
    color: var(--color-indigo);
    border: 1px solid rgba(79, 172, 254, 0.25);
}

.rating-hold {
    background: rgba(245, 166, 35, 0.15);
    color: var(--color-amber);
    border: 1px solid rgba(245, 166, 35, 0.25);
}

.rating-avoid {
    background: rgba(255, 74, 90, 0.15);
    color: var(--color-rose);
    border: 1px solid rgba(255, 74, 90, 0.25);
}

.reason-box {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.015);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    flex-grow: 1;
}

.portal-links-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.portal-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portal-links-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.portal-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.portal-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.2);
}

.portal-btn.screener { background: var(--portal-screener); }
.portal-btn.tickertape { background: var(--portal-tickertape); }
.portal-btn.moneycontrol { background: var(--portal-moneycontrol); }
.portal-btn.chartink { background: var(--portal-chartink); }
.portal-btn.nse { background: var(--portal-nse); }


/* --- FILTER & SEARCH BAR --- */
.search-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    width: 300px;
    transition: var(--transition-smooth);
}

.search-box:focus-within {
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.9rem;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-secondary {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--panel-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- FILTER CONFIG PANEL --- */
.filter-config-panel {
    display: none;
    animation: fadeIn 0.3s ease-out;
    margin-bottom: -1rem;
}

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

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

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.filter-group label span.val-display {
    color: var(--color-cyan);
}

.filter-group input[type="range"] {
    width: 100%;
    accent-color: var(--color-cyan);
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    outline: none;
}

.filter-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.65rem;
    color: var(--text-secondary);
    cursor: help;
    position: relative;
}

/* --- SECTOR TABS --- */
.sector-tabs-container {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.sector-tabs {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    min-width: max-content;
}

.sector-tab {
    padding: 0.5rem 1rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sector-tab:hover {
    color: var(--text-primary);
    background: var(--panel-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.sector-tab.active {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 172, 254, 0.1));
    border-color: rgba(0, 242, 254, 0.3);
    color: var(--color-cyan);
    font-weight: 600;
}

/* --- STOCKS TABLE / DATA GRID --- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.stocks-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.stocks-table th {
    padding: 1rem;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stocks-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

.stocks-table th.sortable:hover {
    color: var(--color-cyan);
}

.stocks-table th.sortable::after {
    content: ' ↕';
    font-size: 0.75rem;
    opacity: 0.4;
    display: inline-block;
    margin-left: 4px;
}

.stocks-table th.sortable.asc::after {
    content: ' ↑';
    opacity: 1;
    color: var(--color-cyan);
}

.stocks-table th.sortable.desc::after {
    content: ' ↓';
    opacity: 1;
    color: var(--color-cyan);
}

.stocks-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.stocks-table tbody tr {
    cursor: pointer;
    transition: var(--transition-smooth);
}

.stocks-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.table-symbol-cell {
    display: flex;
    flex-direction: column;
}

.table-symbol {
    font-weight: 700;
    font-size: 0.95rem;
}

.table-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.price-cell {
    font-weight: 600;
}

.change-cell {
    font-weight: 600;
}

.change-cell.positive { color: var(--color-emerald); }
.change-cell.negative { color: var(--color-rose); }

.score-cell {
    font-weight: 700;
    color: var(--color-cyan);
}

.technical-verdict {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

.indicator-dot.bullish { background-color: var(--color-emerald); box-shadow: 0 0 8px var(--color-emerald); }
.indicator-dot.neutral { background-color: var(--color-amber); box-shadow: 0 0 8px var(--color-amber); }
.indicator-dot.bearish { background-color: var(--color-rose); box-shadow: 0 0 8px var(--color-rose); }

.sparkline-svg {
    stroke-width: 1.5;
    fill: none;
    width: 80px;
    height: 25px;
}

.sparkline-svg.positive {
    stroke: var(--color-emerald);
}

.sparkline-svg.negative {
    stroke: var(--color-rose);
}

/* --- DETAIL MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 12, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: #0b0c1b;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-title-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Modal Metrics Grid */
.modal-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.modal-metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1rem;
}

.modal-metric-card h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.metric-number {
    font-size: 1.4rem;
    font-weight: 700;
}

.metric-indicator-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.metric-indicator-label.good { color: var(--color-emerald); }
.metric-indicator-label.fair { color: var(--color-amber); }
.metric-indicator-label.poor { color: var(--color-rose); }

/* Technical Analysis Table */
.indicator-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.indicator-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.indicator-name {
    color: var(--text-secondary);
}

.indicator-val-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

/* Recommendation Reason Modal Block */
.modal-recommendation-card {
    background: rgba(0, 242, 254, 0.04);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-recommendation-card h4 {
    font-size: 0.85rem;
    color: var(--color-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-recommendation-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Modal Deep Links Footer */
.modal-portal-links-block {
    border-top: 1px solid var(--panel-border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* --- ANIMATIONS --- */
@keyframes radar-sweep {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bar-grow {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: rgba(11, 12, 27, 0.95);
    border: 1px solid var(--panel-border);
    border-left: 4px solid var(--color-cyan);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease-out;
}

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

/* --- CONVICTION SIDEBAR CARDS STYLING --- */
.conviction-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.conviction-card {
    padding: 0.75rem 0.6rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid var(--panel-border) !important;
    border-radius: 10px !important;
    background: rgba(11, 12, 27, 0.45) !important;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.conviction-card:hover {
    transform: translateY(-2px);
    background: rgba(11, 12, 27, 0.6) !important;
}

.conviction-card .card-header-symbol {
    font-size: 0.95rem !important;
    font-weight: 800;
    font-family: var(--font-mono);
}

.conviction-card .card-header-scanner {
    font-size: 0.65rem !important;
}

.conviction-card .card-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.2rem;
    font-size: 0.68rem !important;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.35rem 0.2rem !important;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
}

.conviction-card .card-metrics-row span {
    font-size: 0.58rem !important;
}

/* --- PORTFOLIO TABS STYLING --- */
.portfolio-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}

.portfolio-tab {
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.portfolio-tab.active {
    background: rgba(0, 242, 254, 0.15) !important;
    color: var(--color-cyan) !important;
    box-shadow: inset 0 0 4px rgba(0, 242, 254, 0.2);
}

.portfolio-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

/* --- RESPONSIVE STYLES --- */
@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    aside {
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }
    
    #conviction-digest-container {
        display: none !important;
    }
    
    .monthly-scan-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard-middle-grid {
        grid-template-columns: 1fr !important;
    }
    
    .dashboard-lower-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    main {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .welcome-section h1 {
        font-size: 1.5rem;
    }
    
    .market-indices {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .index-card {
        flex-shrink: 0;
    }
    
    .search-box {
        width: 100%;
    }
    
    .modal-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .sector-tabs {
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Stack elements in learning stats */
    #view-learning > section > div {
        grid-template-columns: 1fr !important;
    }
    
    /* Stack engine status grid in footer */
    #engine-status-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #engine-status-grid > div {
        grid-column: span 1 !important;
    }
    #engine-status-grid > div:last-child {
        grid-column: span 2 !important;
    }
}

/* --- MOBILE RESPONSIVE UTILITIES & OPTIMIZATIONS --- */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    aside {
        padding: 1rem !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
    }
    
    .logo-container {
        justify-content: center;
        width: 100%;
    }
    
    .nav-menu {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem !important;
        width: 100%;
    }
    
    .nav-item {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
        gap: 0.4rem !important;
        min-height: 40px;
    }
    
    /* Touch target optimizations for mobile */
    button, 
    .btn-buy, 
    .btn-sell,
    .btn-delete-trans,
    .scan-button {
        min-height: 40px;
        padding: 0.5rem 1rem !important;
        font-size: 0.82rem !important;
    }
    
    /* Adjust modal content width and heights */
    .modal-content {
        width: 94% !important;
        max-height: 94vh !important;
        border-radius: 16px !important;
    }
    
    .modal-targets-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Mobile Tables to Cards Feed Redesign */
    .table-responsive {
        display: none !important;
    }
    
    .mobile-cards-feed {
        display: flex !important;
        flex-direction: column;
        gap: 1.25rem;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .mobile-stock-card {
        background: rgba(11, 12, 27, 0.45);
        border: 1px solid var(--panel-border);
        border-radius: 16px;
        padding: 1.25rem;
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
        transition: transform 0.2s, background 0.2s;
        cursor: pointer;
        position: relative;
    }
    
    .mobile-stock-card:active {
        transform: scale(0.98);
        background: rgba(11, 12, 27, 0.6);
    }
    
    .mobile-stock-card .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-stock-card .card-symbol-container {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .mobile-stock-card .card-symbol {
        font-size: 1.3rem;
        font-weight: 800;
        color: #ffffff;
        letter-spacing: -0.3px;
        font-family: var(--font-mono);
    }
    
    .mobile-stock-card .card-name {
        font-size: 0.825rem;
        color: var(--text-muted);
        margin-top: -0.5rem;
        text-align: left;
    }
    
    .mobile-stock-card .card-verdict {
        font-size: 0.725rem;
        font-weight: 700;
        padding: 0.25rem 0.6rem;
        border-radius: 20px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .mobile-stock-card .card-metrics-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        background: rgba(255, 255, 255, 0.015);
        border: 1px solid rgba(255, 255, 255, 0.03);
        border-radius: 12px;
        padding: 0.75rem;
    }
    
    .mobile-stock-card .metric-item {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        align-items: flex-start;
    }
    
    .mobile-stock-card .metric-label {
        font-size: 0.65rem;
        color: var(--text-muted);
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }
    
    .mobile-stock-card .metric-val {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-secondary);
        font-family: var(--font-mono);
    }
    
    .mobile-stock-card .card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px dashed rgba(255, 255, 255, 0.05);
        padding-top: 0.75rem;
    }
    
    .mobile-stock-card .card-score {
        font-size: 0.75rem;
        color: var(--text-muted);
    }
    
    /* Touch Friendly elements */
    .touch-friendly {
        min-height: 44px !important;
        padding: 0.6rem 1.25rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Premium Pastel Rating Accents */
    .rating-pastel-buy {
        background: rgba(5, 223, 114, 0.12) !important;
        color: #81c784 !important;
        border: 1px solid rgba(5, 223, 114, 0.2) !important;
    }
    
    .rating-pastel-hold {
        background: rgba(255, 179, 0, 0.12) !important;
        color: #ffb74d !important;
        border: 1px solid rgba(255, 179, 0, 0.2) !important;
    }
    
    .rating-pastel-avoid {
        background: rgba(224, 86, 86, 0.12) !important;
        color: #e57373 !important;
        border: 1px solid rgba(224, 86, 86, 0.2) !important;
    }
}

.mobile-cards-feed {
    display: none;
}

/* --- LOWER DASHBOARD TWO COLUMN GRID --- */
.dashboard-lower-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

#dashboard-right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

/* --- FEED STATUS STYLES --- */
.feed-status-simulated {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-amber) !important;
}
.feed-status-simulated::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-amber);
    box-shadow: 0 0 6px var(--color-amber);
    display: inline-block;
}
.feed-status-live {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-emerald) !important;
}
.feed-status-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-emerald);
    box-shadow: 0 0 6px var(--color-emerald);
    display: inline-block;
}
.feed-status-loading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-indigo) !important;
}
.feed-status-loading::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-indigo);
    box-shadow: 0 0 6px var(--color-indigo);
    display: inline-block;
    animation: pulse 1s infinite alternate;
}

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

/* --- REVERTED VIEW SECTIONS --- */

/* Scanner Badges */
.scanner-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 0.4rem;
    vertical-align: middle;
    white-space: nowrap;
}
.scanner-badge.pos {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-emerald);
    border-color: rgba(16, 185, 129, 0.2);
}
.scanner-badge.neg {
    background: rgba(244, 63, 94, 0.12);
    color: var(--color-rose);
    border-color: rgba(244, 63, 94, 0.2);
}
.scanner-badge.badge-vol,
.scanner-badge.badge-prob,
.scanner-badge.badge-ready,
.scanner-badge.badge-accum,
.scanner-badge.badge-catalyst {
    background: rgba(6, 182, 212, 0.1);
    color: var(--color-cyan);
    border-color: rgba(6, 182, 212, 0.2);
}

/* --- PAPER PORTFOLIO CUSTOM STYLES --- */
.view-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hidden-view {
    display: none !important;
}

.portfolio-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.portfolio-metric-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: var(--transition-smooth);
}
.portfolio-metric-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}
.portfolio-metric-card.pnl-positive {
    box-shadow: 0 0 20px rgba(5, 223, 114, 0.05);
    border-color: rgba(5, 223, 114, 0.15);
}
.portfolio-metric-card.pnl-negative {
    box-shadow: 0 0 20px rgba(255, 74, 90, 0.05);
    border-color: rgba(255, 74, 90, 0.15);
}

.portfolio-metric-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.portfolio-metric-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Actions Buttons & Badges */
.btn-buy {
    background: linear-gradient(135deg, var(--color-emerald), #00c853);
    color: #060713;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.btn-buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(5, 223, 114, 0.4);
}
.btn-buy:active {
    transform: translateY(0);
}

.btn-sell {
    background: linear-gradient(135deg, var(--color-rose), #e63946);
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.btn-sell:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(255, 74, 90, 0.4);
}
.btn-sell:active {
    transform: translateY(0);
}

.btn-in-portfolio {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--panel-border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: not-allowed;
}

.btn-delete-trans {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--panel-border);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: var(--transition-smooth);
}
.btn-delete-trans:hover {
    color: var(--color-rose);
    border-color: rgba(255, 74, 90, 0.3);
    background: rgba(255, 74, 90, 0.05);
}

.btn-reset-portfolio {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-reset-portfolio:hover {
    background: rgba(255, 74, 90, 0.05);
    color: var(--color-rose);
    border-color: rgba(255, 74, 90, 0.2);
}

/* Custom layout adjustments for separate page views */
#view-learning .learning-summary-panel,
#view-themes .active-themes-panel {
    width: 100% !important;
    max-width: 100% !important;
}

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

/* --- TODAY'S TOP GAINERS WIDGET STYLES --- */
.gainer-row {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
    transition: var(--transition-smooth);
}
.gainer-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.gainer-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.gainer-symbol-box {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.gainer-symbol {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.gainer-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.gainer-price-box {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}
.gainer-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.gainer-change {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-emerald);
}
.gainer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.btn-gainer-ai {
    background: rgba(5, 223, 114, 0.08);
    color: var(--color-emerald);
    border: 1px solid rgba(5, 223, 114, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-gainer-ai:hover {
    background: rgba(5, 223, 114, 0.18);
    border-color: rgba(5, 223, 114, 0.35);
}
.btn-gainer-ai.active {
    background: var(--color-emerald);
    color: #060713;
    border-color: var(--color-emerald);
}
.gainer-ai-panel {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(5, 223, 114, 0.02);
    border: 1px solid rgba(5, 223, 114, 0.08);
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.35;
    animation: fadeIn 0.25s ease-out;
}
.gainer-ai-verdict-title {
    color: var(--color-emerald);
    font-weight: 700;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}
.gainer-ai-reasons-list {
    margin: 0;
    padding-left: 1rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.confidence-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.conf-confirmed {
    background: rgba(5, 223, 114, 0.12);
    color: var(--color-emerald);
    border: 1px solid rgba(5, 223, 114, 0.25);
}
.conf-probable {
    background: rgba(79, 172, 254, 0.12);
    color: var(--color-indigo);
    border: 1px solid rgba(79, 172, 254, 0.25);
}
.conf-technical-only {
    background: rgba(245, 166, 35, 0.12);
    color: var(--color-amber);
    border: 1px solid rgba(245, 166, 35, 0.25);
}
.conf-unknown {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- TODAY'S TOP MOVERS STYLES --- */
.movers-tab-btn.active-tab-btn {
    background: rgba(255, 255, 255, 0.08) !important;
}
#btn-movers-gainers.active-tab-btn {
    color: var(--color-emerald) !important;
    text-shadow: 0 0 8px rgba(5, 223, 114, 0.4);
}
#btn-movers-losers.active-tab-btn {
    color: var(--color-rose) !important;
    text-shadow: 0 0 8px rgba(255, 74, 90, 0.4);
}

.loser-change {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-rose);
}
.btn-loser-ai {
    background: rgba(255, 74, 90, 0.08);
    color: var(--color-rose);
    border: 1px solid rgba(255, 74, 90, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-loser-ai:hover {
    background: rgba(255, 74, 90, 0.18);
    border-color: rgba(255, 74, 90, 0.35);
}
.btn-loser-ai.active {
    background: var(--color-rose);
    color: #060713;
    border-color: var(--color-rose);
}
.loser-ai-panel {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 74, 90, 0.02);
    border: 1px solid rgba(255, 74, 90, 0.08);
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.35;
    animation: fadeIn 0.25s ease-out;
}
.loser-ai-verdict-title {
    color: var(--color-rose);
    font-weight: 700;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}
.conf-loser-high {
    background: rgba(255, 74, 90, 0.12);
    color: var(--color-rose);
    border: 1px solid rgba(255, 74, 90, 0.25);
}

/* --- HIGH-DENSITY MONO TYPOGRAPHY --- */
.numeric-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* --- MICRO-ANIMATIONS & HOVER INTERACTIONS --- */
@keyframes pulseOpacity {
    0% { opacity: 0.6; }
    50% { opacity: 1.0; }
    100% { opacity: 0.6; }
}
.pulse-warning {
    animation: pulseOpacity 2s infinite ease-in-out;
}

/* Active squeeze watchlist rows pulsing */
#view-learning table tbody tr.squeeze-row-active,
.squeeze-watchlist-row-active {
    animation: pulseOpacity 2s infinite ease-in-out;
}

/* Main stocks table hover glow animations */
#main-stocks-table tbody tr {
    transition: var(--transition-smooth);
}
#main-stocks-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}
#main-stocks-table tbody tr:hover .scanner-badge {
    transform: scale(1.05);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Strategy specific row hover neon glows */
#main-stocks-table[data-strategy="swing"] tbody tr:hover {
    box-shadow: inset 0 0 10px rgba(0, 242, 254, 0.08), 0 0 15px rgba(0, 242, 254, 0.05);
}
#main-stocks-table[data-strategy="btst"] tbody tr:hover {
    box-shadow: inset 0 0 10px rgba(245, 166, 35, 0.08), 0 0 15px rgba(245, 166, 35, 0.05);
}
#main-stocks-table[data-strategy="breakout"] tbody tr:hover {
    box-shadow: inset 0 0 10px rgba(79, 172, 254, 0.08), 0 0 15px rgba(79, 172, 254, 0.05);
}
#main-stocks-table[data-strategy="accum"] tbody tr:hover {
    box-shadow: inset 0 0 10px rgba(5, 223, 114, 0.08), 0 0 15px rgba(5, 223, 114, 0.05);
}
#main-stocks-table[data-strategy="events"] tbody tr:hover {
    box-shadow: inset 0 0 10px rgba(255, 74, 90, 0.08), 0 0 15px rgba(255, 74, 90, 0.05);
}

/* --- DYNAMIC PORTFOLIO PERFORMANCE GLOWS --- */
.portfolio-metrics-grid.grid-pnl-positive {
    border: 1px solid rgba(5, 223, 114, 0.4) !important;
    box-shadow: 0 0 25px rgba(5, 223, 114, 0.12);
    border-radius: 14px;
    padding: 0.5rem;
    transition: var(--transition-smooth);
}
.portfolio-metrics-grid.grid-pnl-negative {
    border: 1px solid rgba(255, 74, 90, 0.4) !important;
    box-shadow: 0 0 25px rgba(255, 74, 90, 0.12);
    border-radius: 14px;
    padding: 0.5rem;
    transition: var(--transition-smooth);
}

/* --- HIGH-DENSITY VIEW LAYOUTS --- */
#view-dashboard, 
#view-learning, 
#view-themes, 
#view-portfolio {
    border: 1px solid rgba(0, 240, 255, 0.15) !important;
    background: rgba(10, 11, 30, 0.35);
    border-radius: 14px;
    padding: 1.25rem !important;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.02);
}

/* Inner panel adjustments for high density */
#view-dashboard .glass-panel,
#view-learning .glass-panel,
#view-themes .glass-panel,
#view-portfolio .glass-panel {
    padding: 1rem !important;
    margin: 0 !important;
    border-radius: 10px !important;
    border-color: rgba(0, 240, 255, 0.1) !important;
}

.view-container {
    gap: 1.25rem !important;
}

/* Global Status Dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 0.5rem;
    align-self: center;
    transition: background-color 0.3s ease;
    cursor: help;
}
.status-dot.status-healthy {
    background-color: var(--color-emerald);
}
.status-dot.status-degraded {
    background-color: var(--color-amber);
    animation: pulseOpacity 2s infinite ease-in-out;
}
.status-dot.status-offline {
    background-color: var(--color-rose);
    animation: pulseOpacity 1s infinite ease-in-out;
}
.status-dot.status-simulated {
    background-color: var(--text-muted);
}

/* --- Premium UI Custom Adjustments --- */

/* 1. Global Theme Variables - Tuning the Contrast */
:root {
    --bg-main: #0b0f19;         /* Deeper, cleaner midnight backdrop */
    --bg-card: #161d2b;         /* Slightly lighter elevated slate for cards */
    --border-card: rgba(255, 255, 255, 0.05); /* Invisible 1px crisp separation edge */
    
    --text-primary: #ffffff;    /* Maximum readability for core metrics */
    --text-muted: #7c8ba1;      /* Softer silver-grey for labels and timestamps */
    
    --neon-green: #00e676;      /* High-impact green strictly for positive P&L */
    --neon-red: #ff5252;        /* High-impact red strictly for negative P&L */
    
    --btn-neutral: #20293a;     /* Desaturated backdrop for navigation controls */
}

/* 2. Card Layout - Adding Depth and Curves */
.card, .portfolio-item, [class*="Portfolio"] {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: 14px !important; /* Softer, modern premium radius */
    padding: 16px !important;       /* Giving internal metrics room to breathe */
    margin-bottom: 12px !important; /* Clean separation between assets */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 3. Typography Hierarchy - Directing the Eye */
.card-label, .meta-text, label {
    color: var(--text-muted) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timestamp, .date-footer {
    color: var(--text-muted) !important;
    font-size: 0.7rem !important;
    opacity: 0.8;
}

/* 4. De-saturating Structural Buttons */
.btn-previous, .btn-next, .pagination-button {
    background-color: var(--btn-neutral) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
}

.btn-previous:hover, .btn-next:hover {
    background-color: #2b374f !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
