/* ==============================================================================
   1. GLOBAL VARIABLES & BASE RESET
   ============================================================================== */
* {
    box-sizing: border-box;
}

:root {
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --muted-text: #64748b;
    --border-color: #e2e8f0;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #ca8a04;
    --info-color: #0284c7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.page-container,
.tech-container {
    width: 95%;
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 10px;
    background-color: var(--bg-color);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

h2, h1 {
    color: var(--text-color);
    margin-top: 0;
}

h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ==============================================================================
   2. BREADCRUMBS & GLOBAL NAVIGATION
   ============================================================================== */
.breadcrumbs,
.tech-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 500;
    color: var(--muted-text);
}

.breadcrumbs a,
.tech-breadcrumb a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
}

.breadcrumbs a:hover,
.tech-breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumbs span,
.tech-breadcrumb .sep {
    color: #cbd5e1;
}

/* Back Link Utility */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

/* ==============================================================================
   3. COLOR & RATING UTILITIES
   ============================================================================== */
.positive-return, .change-green, .text-green, .val-success { color: var(--success-color) !important; font-weight: 700; }
.negative-return, .change-red, .text-red, .val-danger     { color: var(--danger-color) !important; font-weight: 700; }
.text-orange, .hold-text, .val-warning                     { color: var(--warning-color) !important; font-weight: 700; }
.val-info                                                  { color: var(--info-color) !important; font-weight: 700; }

/* Plain Text Recommendations */
.recommendation-rating,
.recommendation-text {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    text-transform: capitalize !important;
    display: inline !important;
}

.recommendation-rating.buy,
.recommendation-rating.strong-buy,
.recommendation-text.buy,
.recommendation-text.strong-buy {
    color: #15803d !important;
}

.recommendation-rating.hold,
.recommendation-text.hold {
    color: #a16207 !important;
}

.recommendation-rating.sell,
.recommendation-rating.strong-sell,
.recommendation-text.sell,
.recommendation-text.strong-sell {
    color: #b91c1c !important;
}

/* Key Parameter Status Utility Classes */
.kp-blue-text   { color: #2563eb; }
.kp-green-text  { color: #16a34a; }
.kp-orange-text { color: #ea580c; }
.kp-purple-text { color: #9333ea; }
.kp-red-text    { color: #dc2626; }
.kp-teal-text   { color: #0d9488; }

/* ==============================================================================
   4. STOCK DETAIL PAGE (`stock_detail.html`)
   ============================================================================== */


.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    width: 100%;
}



.stock-header-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    flex-shrink: 0;
}

.stock-header-box {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 200px;
}

.header-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.header-metric-row:last-child {
    margin-bottom: 0;
}

.header-metric-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    text-align: right;
}

.date-subtext {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

/* Snapshot Grid */
.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.snapshot-grid .metric-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.snapshot-grid .metric-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--muted-text);
    text-transform: none;
    letter-spacing: 0.5px;
}

.snapshot-grid .metric-value {
    font-size: 22px;
    font-weight: 675;
    margin-top: 10px;
}

.post-results-rating {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted-text);
    font-weight: 600;
}

/* Chart Controls */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.chart-controls h2 {
    margin-bottom: 0;
    margin-right: 16px;
}

.chart-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--muted-text);
}

.chart-btn:hover,
.chart-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Recommendation Rationale */
.theme-box {
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.theme-text {
    font-size: 18px;
    font-weight: 700;
    color: #1e40af;
    margin: 0;
}

.narrative-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.coming-soon {
    font-size: 12px;
    color: var(--muted-text);
    font-style: italic;
    margin-top: 10px;
}

.rationale-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tailwind-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 20px;
}

.tailwind-box h3 {
    color: #166534;
    margin-top: 0;
}

.headwind-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
}

.headwind-box h3 {
    color: #991b1b;
    margin-top: 0;
}

.tailwind-box ul, .headwind-box ul {
    padding-left: 20px;
    margin: 0;
}

.tailwind-box li, .headwind-box li {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 6px;
}

/* Clean Key Parameters Grid */
.key-parameters-card .key-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.key-parameters-card .kp-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header / Title */
.kp-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color); /* Uses standard dark slate color */
    text-align: center;
}

/* Neutral Main Value Display */
.kp-status {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
    margin: 8px 0 12px 0;
}

.kp-divider {
    border-top: 1px dashed var(--border-color);
    margin-bottom: 10px;
}

/* Footer & Secondary Metrics */
.kp-footer {
    font-size: 13px;
    color: var(--muted-text);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.kp-label {
    font-weight: 500;
    color: var(--muted-text);
}

.kp-value {
    font-weight: 600;
    color: var(--text-color);
}

.kp-sep {
    margin: 0 4px;
    color: #cbd5e1;
}

/* Financial Table */
.financial-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.financial-table th, .financial-table td {
    padding: 12px 16px;
    font-size: 17px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.financial-table th:last-child, .financial-table td:last-child {
    border-right: none;
}

.financial-table th:first-child, .financial-table td:first-child {
    text-align: left;
    font-weight: 520;
    width: 320px;
    background: #ffffff;
}

.financial-table .actuals-header {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 700;
}

.financial-table .forecasts-header {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 700;
}

/* About Details */
.about-section summary {
    font-weight: 700;
    cursor: pointer;
    color: var(--primary-color);
    padding: 8px 0;
}

.about-content {
    margin-top: 12px;
    line-height: 1.6;
    color: #334155;
}

/* ==============================================================================
   5. TECHNICAL ANALYSIS PAGE (`technical.html`)
   ============================================================================== */
.tech-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-title h1 {
    margin: 0 0 4px 0;
    font-size: 1.85rem;
    font-weight: 700;
}

.tech-title p {
    margin: 0;
    color: var(--muted-text);
    font-size: 0.95rem;
}

.cmp-badge {
    background: #e2e8f0;
    color: #1e293b;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.decision-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.decision-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.signal-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.signal-title {
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0.5px;
    color: var(--muted-text);
    font-weight: 600;
}

.signal-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: none;
}

.badge-buy { background: #dcfce7; color: #15803d; }
.badge-strong-buy { background: #16a34a; color: #ffffff; }
.badge-avoid { background: #fee2e2; color: #b91c1c; }
.badge-neutral { background: #f1f5f9; color: #475569; }

.score-box {
    font-size: 0.9rem;
    color: var(--muted-text);
}

.score-box strong {
    font-size: 1.1rem;
    color: var(--text-color);
}

.decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
    text-align: center;
}

.num-box {
    padding: 14px;
    background: #f8fafc;
    border-radius: 8px;
}

.num-box .label {
    font-size: 0.75rem;
    text-transform: none;
    color: var(--muted-text);
    font-weight: 600;
    margin-bottom: 4px;
}

.num-box .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.no-setup-msg {
    margin-top: 12px;
    color: var(--muted-text);
    font-size: 0.9rem;
}

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ind-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.ind-card .ind-label {
    font-size: 0.75rem;
    text-transform: none;
    font-weight: 700;
    color: var(--muted-text);
}

.ind-card .ind-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 8px;
}

.ind-card .ind-sub {
    font-size: 0.8rem;
    color: var(--muted-text);
    margin-top: 4px;
}

.chart-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chart-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px 0;
}

/* ==============================================================================
   6. STOCK OVERVIEW / UNIVERSE PAGE (`stock_overview.html`)
   ============================================================================== */
.stock-universe-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
}

.stock-universe-sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    box-sizing: border-box;
}

.navigation-heading {
    font-weight: 700;
    color: var(--muted-text);
    margin: 16px 0 8px 0;
    font-size: 13px;
    text-transform: none;
}

.navigation-list a {
    display: block;
    padding: 8px 12px;
    
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 4px;
}

.navigation-list a:hover,
.navigation-list a.active {
    
   
    font-weight: 600;
}

.stock-universe-workspace {
    flex: 1;
    min-width: 0; /* Critical: prevents grid blowout */
}

.workspace-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.workspace-subtitle {
    font-size: 14px;
    color: var(--muted-text);
    margin: 0 0 16px 0;
}

.company-grid {
    display: grid;
    /* Automatically creates columns that are at LEAST 220px wide */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.stock-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.company-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.company-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.company-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.company-header {
    display: flex;
    font-size: 14px;
    justify-content: space-between;
    font-weight: 700;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.company-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: transparent;
    padding: 0;
    margin: 0;
    width: 100%;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-divider {
    color: #cbd5e1;
}

.metric-item .metric-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--muted-text);
}

.metric-item .metric-value {
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
}

/* ==============================================================================
   7. SEARCH RESULTS TABLE PAGE (`search_results.html`)
   ============================================================================== */
.ideas-table {
    width: 100%;
    border-collapse: collapse;
}

.ideas-table th, 
.ideas-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.ideas-table th {
    background: #f8fafc;
    color: var(--muted-text);
    font-size: 13px;
    font-weight: 700;
    text-transform: none;
}

.ideas-table td a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.ideas-table td a:hover {
    text-decoration: underline;
}

/* ==============================================================================
   8. RESPONSIVE BREAKPOINTS
   ============================================================================== */
@media (max-width: 1024px) {
    .snapshot-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .key-parameters-card .key-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .stock-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stock-header-grid {
        width: 100%;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .snapshot-grid,
    .rationale-grid,
    .key-parameters-card .key-grid {
        grid-template-columns: 1fr;
    }
    .stock-universe-container {
        flex-direction: column;
    }
    .stock-universe-sidebar {
        width: 100%;
    }
}

/* ==============================================================================
   9. EMERGENCY HOTFIX: LOGO, CHARTS & GLOBAL RESETS
   ============================================================================== */

/* Fix giant logo / unconstrained images */
img {
    max-width: 100%;
    height: auto;
}

.logo, 
.navbar-brand img, 
.site-logo, 
header img {
    max-height: 45px !important;
    width: auto !important;
    object-fit: contain;
}

/* Fix chart explosion (prevents canvas from growing infinitely) */
canvas {
    max-width: 100% !important;
    max-height: 420px !important;
    width: 100% !important;
}

.chart-card,
.card-body {
    position: relative;
    max-height: 500px;
}

/* Base Nav & Grid Containment Fix */
header, .navbar, .portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

/* ==============================================================================
   10. HOME PAGE (`index.html`) STYLES
   ============================================================================== */

.vista-home {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.vista-welcome {
    margin-bottom: 24px;
}

.vista-welcome h1 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-color, #0f172a);
}

.vista-welcome p {
    font-size: 15px;
    color: var(--muted-text, #64748b);
    margin: 0;
}

/* Section Titles */
.module-section-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.module-section-subtitle {
    font-size: 14px;
    color: var(--muted-text, #64748b);
    margin: 0;
}

.section-gap {
    height: 32px;
}

/* Market Dashboard Container */
.market-dashboard-section {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 20px 24px 24px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    width: 100%;
    box-sizing: border-box;
}

.market-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

/* Cleaned Up "Last Updated" Text (No Input Box Look) */
.market-dashboard-timestamp {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.market-dashboard-timestamp strong {
    color: #334155;
    font-weight: 600;
}

/* Market Grid - Properly Constrained 4-Column Grid */
.market-grid.unified-layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

.market-card-item {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex/grid children from bursting out */
    box-sizing: border-box;
}

.market-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.market-asset-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color, #0f172a);
    white-space: nowrap;
}

.market-asset-value-metric {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-color, #0f172a);
    white-space: nowrap;
}

.market-change-pct {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.market-chart-container {
    width: 100%;
    min-height: 150px;
    max-height: 160px;
    position: relative;
}

.market-institutional-chart {
    width: 100% !important;
    height: 100% !important;
}

/* Explore Vista Grid (6 Cards 3x2) */
.module-section {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
    box-sizing: border-box;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px;
    margin-top: 20px;
}

.module-card {
    background: #f8fafc;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

.module-card:hover {
    transform: translateY(-2px);
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.module-title {
    font-size: 16px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.module-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}
.explore-vista-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.screeners-link {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.screeners-link:hover {
    text-decoration: underline;
}

/* Responsive Fixes */
@media (max-width: 1100px) {
    .market-grid.unified-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .market-grid.unified-layout,
    .module-grid {
        grid-template-columns: 1fr !important;
    }
}
/* ==============================================================================
   11. GLOBAL HEADER & NAVIGATION (`base.html`)
   ============================================================================== */
.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

/* Search Bar Alignment & Match Height */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 900px; /* Expands search container width */
    flex: 1;           /* Allows search bar to take up available space in the header center */
    margin: 0 40px;    /* Keeps a comfortable distance from Logo and Profile */
}

.global-search {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.global-search:focus {
    border-color: var(--primary-color);
}

.search-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.search-btn:hover {
    background: var(--primary-hover);
}

.user-menu {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-color);
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
}

/* ==============================================================================
   12. STOCK DETAIL HEADER & SNAPSHOT STYLES (FULL-WIDTH SPREAD)
   ============================================================================== */

/* Stock Header - Structure of the label (DH) */
.stock-header {
    
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.stock-header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    width: 100%;
}

/* Ticker Name  - Ticker Title (DH) */
.stock-header-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    flex: 1 1 auto;
    margin: 0;
}
/* Industry Label - (DH) */
.stock-header-title .industry-tag {
    font-size: 19px;
    text-decoration: none;
    color: var(--muted-text);
}

.stock-header-title .industry-tag strong {
    color: var(--primary-color);
}

.industry-tag {
    font-size: 20px;
    color: #64748b;
    margin-left: 12px;
    text-decoration: none;
}

/* Spread 3 Boxes Full-Width Across Container */
.stock-header-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.stock-header-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.header-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    width: 100%;
}

.header-metric-label {
    color: #64748b;
    font-weight: 600;
}

.header-metric-label {
    font-size: 18px;
    color: var(--muted-text);
}

.header-metric-val {
    font-weight: 700;
    color: #0f172a;
}

.cmp-large {
    font-size: 22px;
    font-weight: 700;
    color: #2563eb !important; /* Modern Royal Blue */
}

/* Color Rules for CAGR & Changes */
.val-green {
    color: #16a34a !important;
    font-weight: 700;
}

.val-red {
    color: #dc2626 !important;
    font-weight: 700;
}

/* Forecast Recommendation Text Colors (No Badges) */
.recommendation-badge {
    padding: 0;
    background: transparent !important;
    border-radius: 0;
    font-size: 22px;
    font-weight: 700;
    text-transform: capitalize;
}

/* Green for Buy & Strong Buy */
.recommendation-badge.buy,
.recommendation-badge.strong-buy,
.recommendation-badge.strong_buy {
    color: #15803d !important; /* Green */
}

/* Orange for Hold */
.recommendation-badge.hold {
    color: #c2410c !important; /* Orange */
}

/* Red for Sell & Strong Sell */
.recommendation-badge.sell,
.recommendation-badge.strong-sell,
.recommendation-badge.strong_sell {
    color: #b91c1c !important; /* Red */
}

.date-subtext {
    font-size: 14px;
    color: #94a3b8;
}

/* Responsive Grid Adjustment */
@media (max-width: 900px) {
    .stock-header-grid {
        grid-template-columns: 1fr;
    }
}


/* ==============================================================================
   MACRO INTELLIGENCE PAGE STYLES (ISOLATED SECTION)
   ============================================================================== */

/* Page Container & Layout Scope */
.page-container {
    background-color: #f8fafc;
}

/* Macro Indicator Tiles & Grid */
.macro-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 18px;
}

.macro-tile {
    background: #ffffff;
    border: 1px solid #d9e2ef;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.macro-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

.macro-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.macro-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
    width: 70%;
}

.macro-value {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
    color: #0f172a;
    text-align: right;
}

/* Direction Status Indicators */
.macro-status-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 12px;
}

.macro-direction {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.macro-direction.improving {
    color: #16a34a;
}

.macro-direction.deteriorating {
    color: #dc2626;
}

.macro-chart {
    height: 120px;
    margin-top: 12px;
    position: relative;
}

/* Narrative & Macro Regime Cards Grid */
.macro-overview-grid {
    display: grid !important;
    grid-template-columns: 300px 1fr !important;
    gap: 24px !important;
    margin-top: 20px;
}

.regime-card,
.summary-card,
.driver-card,
.risk-card {
    background: #fafcff;
    border: 1px solid #dbe5f2;
    border-radius: 12px;
    padding: 22px;
}

.section-label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 14px;
    text-transform: none;
    letter-spacing: 0.4px;
}

/* Regime Status Pills */
.regime-pill {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
}

.regime-strong-positive {
    background: #166534;
    color: #ffffff;
}

.regime-positive {
    background: #16a34a;
    color: #ffffff;
}

.regime-neutral {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
}

.regime-negative {
    background: #ea580c;
    color: #ffffff;
}

.regime-strong-negative {
    background: #dc2626;
    color: #ffffff;
}

.regime-outlook {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

.summary-text {
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
}

/* Key Drivers & Key Risks Grid */
.macro-driver-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
    margin-top: 24px;
}

.driver-list,
.risk-list {
    margin: 0;
    padding-left: 20px;
}

.driver-list li {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #166534;
}

.risk-list li {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #991b1b;
}

/* Responsive Viewport Overrides for Macro Page */
@media (max-width: 900px) {
    .macro-overview-grid,
    .macro-driver-grid {
        grid-template-columns: 1fr !important;
    }
}

.vista-outlook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.vista-outlook-header h2 {
    margin: 0;
}

.btn-technical {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #2563eb;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-technical:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.industry-link {
    text-decoration: none;
}

/* ==============================================================================
   STOCK 360 DASHBOARD PANELS
   ============================================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.dashboard-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.dashboard-table {
    width: 100%;
}

.dashboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f8fafc;
}

.dashboard-row:last-child {
    border-bottom: none;
}

.dashboard-label {
    color: var(--muted-text);
    font-size: 15px;
    font-weight: 500;
}

.dashboard-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    text-align: right;
}

@media (max-width:900px){

.dashboard-grid{

grid-template-columns:1fr;

}

}

.consensus-box{

    margin-top:20px;

    display:flex;

    justify-content:space-around;

    background:#f7f9fc;

    border:1px solid #d9e2ef;

    border-radius:8px;

    padding:18px;

    text-align:center;

}

.consensus-box div{

    flex:1;

}

/* ==========================================
   Analyst Recommendation Styles
========================================== */

.buy-label{

    color:#16a34a;
    font-weight:600;

}

.sell-label{

    color:#dc2626;
    font-weight:600;

}

.hold-label{

    color:#d97706;
    font-weight:600;

}

/* ==========================================
   Analyst View
========================================== */

.analyst-view-grid{

    display:grid;

    grid-template-columns:220px 1fr;

    gap:24px;

    margin-top:15px;

}

.analyst-summary-panel{

    border-right:1px solid #e5e7eb;

    padding-right:18px;

}

.summary-block{

    margin-bottom:28px;

}

.summary-label{

    font-size:13px;

    font-weight:700;

    color:#6b7280;

    text-transform:uppercase;

    margin-bottom:8px;

}

.summary-value{

    font-size:15px;

    line-height:1.6;

}

.analyst-narrative-panel{

    padding-left:5px;

}

.analyst-text{

    font-size:15px;

    line-height:1.8;

    text-align:justify;

    color:#374151;

}

/* ===========================================
   Analyst Intelligence
=========================================== */

.analyst-top-layout{
    display:flex;
    gap:24px;
    align-items:flex-start;
}

.analyst-table-panel{
    flex:4;
}

.analyst-consensus-panel{
    flex:1;
    border:1px solid #dbe3ef;
    border-radius:10px;
    padding:20px;
    background:#fff;
}

.consensus-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:14px 0;
    border-bottom:1px solid #edf1f7;
}

.consensus-row:last-child{
    border-bottom:none;
}

.consensus-label{
    font-size:13px;
    color:#6b7280;
    font-weight:600;
}

.consensus-value{
    font-size:18px;
    font-weight:700;
}

.analyst-narrative-card{
    width:100%;
}

.narrative-heading{
    font-size:18px;
    font-weight:700;
    margin-bottom:16px;
}

.narrative-text{
    font-size:15px;
    line-height:1.8;
    color:#374151;
}


.screeners-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.screeners-button:hover {
    background: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}