/* ============================================================
   NEWS HUB v2.0 — CSS Extensions
   Tab Navigation, Gauge, Sankey, Quadrant, Earnings, Word Cloud
   ============================================================ */

/* === 3.1 TAB NAVIGATION === */
.dashboard-tab-nav {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: rgba(16, 20, 26, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin: 0 0 16px 0;
}
.tab-btn {
    flex: 1;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.tab-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}
.tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.15), rgba(0, 229, 255, 0.08));
    border-color: rgba(0, 230, 118, 0.3);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.1);
}
.tab-panel {
    display: none;
    animation: fadeInTab 0.25s ease;
}
.tab-panel.active {
    display: block;
}
@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === 3.2 GAUGE CHART === */
.gauge-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}
.gauge-svg-wrapper {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
}
.gauge-label { text-align: center; margin-top: 8px; }
.gauge-score { font-size: 28px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.gauge-status {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.gauge-message {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin-top: 8px;
    line-height: 1.5;
    padding: 0 8px;
}
.gauge-ai-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px; /* Tăng từ 9px → 11px đạt WCAG accessibility minimum */
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: white;
    letter-spacing: 0.5px;
    margin-top: 6px;
    text-transform: uppercase;
}
.gauge-warning-strip {
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 23, 68, 0.15);
    border: 1px solid rgba(255, 23, 68, 0.3);
    border-radius: 6px;
    font-size: 11px;
    color: #ff6b6b;
    text-align: center;
    margin-top: 8px;
    animation: pulseRed 2s infinite;
}
@keyframes pulseRed {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

/* === 3.3 SANKEY & QUADRANT === */
.sankey-card { padding: 0 !important; overflow: hidden; min-height: 260px; }
.sankey-header { padding: 14px 16px 8px; display: flex; align-items: center; justify-content: space-between; }
.sankey-svg-wrapper { width: 100%; height: 200px; }
.sankey-ai-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(0,230,118,0.15), rgba(0,229,255,0.1));
    border: 1px solid rgba(0,230,118,0.2);
    color: #00e676;
    margin: 0 16px 10px;
}
.quadrant-card { padding: 0 !important; overflow: hidden; min-height: 280px; position: relative; }
.quadrant-header { padding: 14px 16px 8px; }
.quadrant-svg-wrapper { width: 100%; height: 220px; position: relative; }
.quadrant-label {
    position: absolute;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    pointer-events: none;
}
.quadrant-label.leading   { top: 8px;    right: 8px;  color: #00e676; }
.quadrant-label.weakening { bottom: 8px; right: 8px;  color: #ffc400; }
.quadrant-label.improving { top: 8px;    left: 8px;   color: #00e5ff; }
.quadrant-label.lagging   { bottom: 8px; left: 8px;   color: #ff1744; }

/* === 3.4 EARNINGS CALENDAR GLASSMORPHISM === */
.earnings-card { padding: 16px; min-height: 180px; }
.earnings-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.earnings-list::-webkit-scrollbar { width: 4px; }
.earnings-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.earnings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s;
}
.earnings-item:hover { background: rgba(255,255,255,0.07); }
.earnings-item-ticker { font-weight: 700; font-size: 13px; color: #ffffff; min-width: 48px; }
.earnings-item-quarter { font-size: 10px; color: #94a3b8; }
.earnings-item-date { font-size: 11px; color: #94a3b8; }
.earnings-risk-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.earnings-risk-badge.risk {
    background: rgba(255,23,68,0.15);
    color: #ff4466;
    border: 1px solid rgba(255,23,68,0.3);
    animation: blinkBadge 1.5s infinite;
}
.earnings-risk-badge.normal {
    background: rgba(0,230,118,0.1);
    color: #00e676;
    border: 1px solid rgba(0,230,118,0.2);
}
@keyframes blinkBadge {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}
/* Badge cảnh báo chéo (Ticker Bar & News Cards) */
.risk-badge-inline {
    display: none;
    font-size: 11px; /* Tăng từ 9px → 11px đạt WCAG accessibility minimum */
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255,23,68,0.2);
    color: #ff4466;
    border: 1px solid rgba(255,23,68,0.3);
    margin-left: 4px;
    vertical-align: middle;
    animation: blinkBadge 1.5s infinite;
}
.risk-badge-inline.visible { display: inline-block; }

/* === 3.5 WORD CLOUD === */
.word-cloud-card { 
    padding: 0 !important; 
    overflow: hidden; 
    min-height: 260px; 
    display: flex; 
    flex-direction: column; 
}
.word-cloud-header { padding: 14px 16px 8px; flex-shrink: 0; }
.word-cloud-svg-wrapper { flex: 1; width: 100%; min-height: 160px; }
.word-cloud-warning {
    padding: 10px 14px;
    background: rgba(255,23,68,0.12);
    border-top: 1px solid rgba(255,23,68,0.2);
    font-size: 11px;
    color: #ff6b6b;
    line-height: 1.5;
    flex-shrink: 0;
    margin-top: auto;
}
@keyframes dangerPulse {
    0%, 100% { fill: #ff2d55; opacity: 1; }
    50%       { fill: #ff6b8a; opacity: 0.7; }
}
.word-penny { animation: dangerPulse 1.5s infinite; cursor: pointer; }
.word-normal { cursor: pointer; transition: opacity 0.2s; }
.word-normal:hover { opacity: 0.8; }

/* === MACRO CHART WRAPPERS === */
.macro-chart-wrapper { width: 100%; height: 220px; position: relative; }
.macro-chart-card { padding: 12px 16px 8px; min-height: 260px; }
.macro-chart-title {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}
.chart-crosshair-line {
    stroke: rgba(255,255,255,0.3);
    stroke-width: 1;
    stroke-dasharray: 4 4;
    pointer-events: none;
}

/* === ZONE GRID CHO 3 TAB === */
.macro-zone-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.macro-gauge-full { grid-column: 1 / -1; }
.flow-zone-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.sentiment-zone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 768px) {
    .macro-zone-grid,
    .flow-zone-grid,
    .sentiment-zone-grid { grid-template-columns: 1fr; }
    .macro-gauge-full { grid-column: 1; }
    .dashboard-tab-nav { flex-wrap: wrap; }
    .tab-btn { flex: none; min-width: calc(50% - 4px); }
}

/* === PHASE 9: UX POLISH === */

/* Skeleton loading shimmer — hiện khi card chưa có data */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.09) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    min-height: 40px;
}

/* Blink-danger: Word Cloud Penny đỏ nhấp nháy */
@keyframes blink-danger {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 4px #ff1744); }
    50%       { opacity: 0.6; filter: drop-shadow(0 0 2px #ff1744); }
}
.blink-danger { animation: blink-danger 1.2s infinite; }

/* Source badge (mock / tcbs / fireant) */
.source-badge {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(148,163,184,0.15);
    color: #64748b;
    border: 1px solid rgba(148,163,184,0.2);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: lowercase;
    margin-left: 6px;
    vertical-align: middle;
}
.source-badge.live {
    background: rgba(0,230,118,0.1);
    color: #00e676;
    border-color: rgba(0,230,118,0.2);
}

/* Earnings risk badge bổ sung: màu đỏ khi gần (1-3 ngày) */
.earnings-risk-badge.risk-urgent {
    background: rgba(255,23,68,0.25);
    color: #ff1744;
    border: 1px solid rgba(255,23,68,0.5);
    animation: blinkBadge 0.8s infinite;
}

/* Director card content */
.director-content {
    padding: 8px 4px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-primary, #e2e8f0);
}
.director-content p { margin: 0; }

/* Tooltip dùng chung cho D3 charts */
.d3-tooltip {
    position: absolute;
    background: rgba(10,14,20,0.95);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    color: #e2e8f0;
    pointer-events: none;
    z-index: 9999;
    backdrop-filter: blur(8px);
    white-space: nowrap;
    line-height: 1.6;
}

/* CPI legend nhỏ bên phải chart */
.cpi-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 8px 8px;
    font-size: 11px; /* Tăng từ 9px → 11px đạt WCAG accessibility minimum */
    color: #64748b;
}
.cpi-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cpi-legend-dot {
    width: 8px;
    height: 2px;
    border-radius: 1px;
}

/* Macro gauge row responsive */
@media (max-width: 640px) {
    .macro-gauge-row { flex-direction: column !important; align-items: center !important; }
    .gauge-card { min-height: auto; }
    .sankey-svg-wrapper { height: 160px; }
    .quadrant-svg-wrapper { height: 180px; }
    .word-cloud-svg-wrapper { height: 140px; }
}

/* ============================================================
   FLAT LAYOUT v3.0 — Section styles (bỏ Tab, cuộn thẳng)
   ============================================================ */

/* Earnings card chiếm full width trong sentiment grid */
.sentiment-zone-grid .earnings-card {
    grid-column: 1 / -1;
}

/* Dashboard zone grid: AI Reports + AI News ngang nhau */
.dashboard-zone-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 900px) {
    .dashboard-zone-grid { grid-template-columns: 1fr; }
}

/* Hero zone: Heatmap lớn bên trái, bản tin bên phải */
.hero-zone-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 1100px) {
    .hero-zone-grid { grid-template-columns: 1fr; }
}

/* Section label - phân cách các section */
.news-section {
    margin-bottom: 32px;
}
.news-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted, #64748b);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.news-section-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, #00e676, #00bcd4);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Hover effect cho eco-item trong Blog sidebar */
.eco-item {
    transition: background 0.15s ease;
    border-radius: 8px;
    padding: 6px;
    margin: -6px;
}
.eco-item:hover {
    background: rgba(255,255,255,0.04);
}

/* ============================================================
   DESKTOP: top-nav-row1 — search chiếm 300px cố định, ticker flex:1
   ============================================================ */
.bento-top-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
/* Desktop: row1 không wrap, search cố định 300px */
@media (min-width: 769px) {
    .top-nav-row1 {
        flex: 0 0 auto !important;
        gap: 12px !important;
    }
    .top-nav-row1 .omni-search-wrapper {
        flex: 0 0 300px !important;
    }
}

/* ============================================================
   MOBILE RESPONSIVE — STOCK36 PRO NEWS
   Breakpoints: 1100px | 900px | 768px | 640px | 480px
   ============================================================ */

/* ── 1. TOP NAV: 2 hàng trên mobile (search+alert / ticker) ── */
@media (max-width: 768px) {
    .bento-top-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }
    /* Hàng 1: search + alert cùng hàng */
    .top-nav-row1 {
        flex: 0 0 auto !important;
        width: 100% !important;
    }
    .top-nav-row1 .omni-search-wrapper {
        flex: 1 !important;
        max-width: none !important;
    }
    /* Ẩn gợi ý phím tắt Ctrl K trên mobile */
    #omni-search-shortcut {
        display: none !important;
    }
    /* Ticker: full width, chiều cao giới hạn */
    .vsa-ticker-wrapper {
        flex: 0 0 auto !important;
        width: 100% !important;
        margin: 0 !important;
        height: 28px !important;
        overflow: hidden !important;
    }
}

/* ── 2. MACRO ZONE GRID (2-col → 1-col) ── */
@media (max-width: 900px) {
    .macro-zone-grid {
        grid-template-columns: 1fr !important;
    }
    .macro-gauge-full {
        grid-column: 1 !important;
    }
}

/* ── 3. FLOW ZONE GRID (Fear&Greed + Quadrant) ── */
@media (max-width: 900px) {
    .flow-zone-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── 4. SENTIMENT ZONE GRID (Sankey + WordCloud + BCTC) ── */
@media (max-width: 900px) {
    .sentiment-zone-grid {
        grid-template-columns: 1fr !important;
    }
    .sentiment-zone-grid .earnings-card {
        grid-column: 1 !important;
    }
}

/* ── 5. HERO ZONE GRID (Heatmap + Bản Tin) ── */
@media (max-width: 1100px) {
    .hero-zone-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── 6. CHỈ SỐ LIÊN THỊ TRƯỜNG (3 widgets ngang → dọc) ── */
@media (max-width: 768px) {
    #inter-market-widgets {
        flex-direction: column !important;
        height: auto !important;
        gap: 10px !important;
    }
    #inter-market-widgets > div {
        flex: 0 0 130px !important;
        height: 130px !important;
        width: 100% !important;
    }
}

/* ── 7. HÀNG OMO + A.I NEWS (ngang → dọc) ── */
@media (max-width: 768px) {
    section#section-heatmap > div[style*="display:flex"][style*="gap:16px"],
    section#section-heatmap > div[style*="display: flex"][style*="gap:16px"] {
        flex-direction: column !important;
    }
    /* OMO: auto width thay vì 340px cố định */
    .data-sbv-card[style*="flex:0 0 340px"],
    .data-sbv-card[style*="flex: 0 0 340px"] {
        flex: 1 1 auto !important;
        width: 100% !important;
    }
}

/* ── 8. SVG CHARTS: không được cứng width, phải responsive ── */
@media (max-width: 768px) {
    /* D3 charts: force SVG co vừa container */
    #sbv-vnindex-container svg,
    #cpi-overlay-container svg,
    #sankey-container svg,
    #sector-rotation-container svg,
    #word-cloud-container svg,
    #macro-gauge-container svg,
    #fear-greed-container svg {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
    /* Wrapper chiều cao giảm để không quá cao trên mobile */
    .macro-chart-wrapper  { height: 180px !important; }
    .sankey-svg-wrapper   { height: 160px !important; }
    .quadrant-svg-wrapper { height: 170px !important; }
    .word-cloud-svg-wrapper { height: auto !important; min-height: 160px !important; }
}

/* ── 9. BENTO GRID MAIN (sidebar + main layout) ── */
@media (max-width: 1024px) {
    .bento-grid {
        flex-direction: column !important;
    }
    .bento-sidebar-col {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ── 10. GLOBAL BENTO CARD padding nhỏ hơn trên mobile ── */
@media (max-width: 640px) {
    .bento-card {
        padding: 12px !important;
    }
    .bento-card-title {
        font-size: 12px !important;
    }

    /* Hero Director Card: font nhỏ hơn */
    .director-content {
        font-size: 12px !important;
        line-height: 1.55 !important;
    }

    /* Gauge: compact */
    .gauge-score   { font-size: 22px !important; }
    .gauge-status  { font-size: 11px !important; }
    .gauge-card    { min-height: 180px !important; }

    /* Macro chart: giảm height */
    .macro-chart-card    { min-height: 220px !important; }

    /* Heatmap: giảm chiều cao */
    .heatmap-container { min-height: 200px !important; }

    /* AI News ticker: giảm height */
    #ai-news-ticker-wrapper  { min-height: 220px !important; }

    /* Section labels: nhỏ hơn */
    .news-section-label {
        font-size: 10px !important;
        letter-spacing: 1px !important;
    }

    /* Earnings list: tăng max-height để không bị cụt */
    .earnings-list { max-height: 260px !important; }

    /* Tab nav: wrap 2 cột */
    .dashboard-tab-nav { flex-wrap: wrap; gap: 4px; }
    .tab-btn { flex: none !important; min-width: calc(50% - 4px) !important; font-size: 11px !important; padding: 8px 10px !important; }
}

/* ── 11. Earnings items: gọn hơn trên mobile ── */
@media (max-width: 640px) {
    .earnings-item {
        padding: 6px 8px !important;
        gap: 4px !important;
    }
    .earnings-item-ticker { min-width: 40px !important; font-size: 12px !important; }
    .earnings-item-date   { font-size: 10px !important; }
    .earnings-item-quarter { font-size: 11px !important; }
    .earnings-risk-badge  { font-size: 11px !important; padding: 1px 5px !important; }
}

/* ── 12. Section news: spacing tối ưu ── */
@media (max-width: 768px) {
    .app-container {
        overflow-x: hidden;
        padding: 10px 10px !important;
    }
    .news-section {
        margin-bottom: 20px !important;
    }
    .bento-top-nav {
        margin-bottom: 10px;
    }
}

/* ── 13. Light theme: section label trên nền trắng ── */
body.light-theme .news-section-label {
    border-bottom-color: rgba(0,0,0,0.08);
}

/* ── 14. AI Reports trong sidebar: scrollable trên tablet ── */
@media (max-width: 1024px) {
    #ai-reports-list {
        max-height: 280px;
        overflow-y: auto;
    }
}

/* ── 15. Butterfly Alert Modal Hover ── */
.butterfly-item {
    transition: background-color 0.2s ease, transform 0.1s ease;
    background: var(--card-bg, rgba(255,255,255,0.02));
}
.butterfly-item:hover {
    background: var(--bg-dark, rgba(255,255,255,0.06));
}

/* ── 16. Sankey AI Tag ── */
.sankey-ai-tag {
    position: absolute; 
    bottom: 16px; 
    left: 16px; 
    font-size: 11px; 
    font-weight: 600; 
    padding: 4px 10px; 
    border-radius: 6px; 
    background: var(--card-bg, rgba(0,0,0,0.6)); 
    border: 1px solid var(--border-color, rgba(255,255,255,0.1)); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
    z-index: 10; 
    pointer-events: none;
}

/* ── 2. MACRO ZONE GRID (2-col → 1-col) ── */
@media (max-width: 900px) {
    .macro-zone-grid {
        grid-template-columns: 1fr !important;
    }
    .macro-gauge-full {
        grid-column: 1 !important;
    }
}

/* ── 3. FLOW ZONE GRID (Fear&Greed + Quadrant) ── */
@media (max-width: 900px) {
    .flow-zone-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── 4. SENTIMENT ZONE GRID (Sankey + WordCloud + BCTC) ── */
@media (max-width: 900px) {
    .sentiment-zone-grid {
        grid-template-columns: 1fr !important;
    }
    .sentiment-zone-grid .earnings-card {
        grid-column: 1 !important;
    }
    .sankey-ai-tag {
        position: static !important;
        margin-top: 10px;
        width: calc(100% - 20px);
        margin-left: 10px;
        text-align: center;
        box-shadow: none;
    }
}

/* ── 5. HERO ZONE GRID (Heatmap + Bản Tin) ── */
@media (max-width: 1100px) {
    .hero-zone-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── 6. CHỈ SỐ LIÊN THỊ TRƯỜNG (3 widgets ngang → dọc) ── */
@media (max-width: 768px) {
    #inter-market-widgets {
        flex-direction: column !important;
        height: auto !important;
        gap: 10px !important;
    }
    #inter-market-widgets > div {
        flex: 0 0 120px !important;
        height: 120px !important;
    }
}

/* ── 7. HÀNG OMO + A.I NEWS (song song → dọc) ── */
@media (max-width: 768px) {
    /* Row chứa OMO và AI News */
    .data-sbv-card[style*="flex:0 0 340px"],
    .data-sbv-card[style*="flex: 0 0 340px"] {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    /* Flex row wrapper chứa OMO + AI News */
    section#section-heatmap > div[style*="display:flex"][style*="gap:16px"],
    section#section-heatmap > div[style*="display: flex"][style*="gap:16px"] {
        flex-direction: column !important;
    }
}

/* ── 8. BENTO GRID MAIN (sidebar + main layout) ── */
@media (max-width: 1024px) {
    .bento-grid {
        flex-direction: column !important;
    }
    .bento-sidebar-col {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ── 9. AI REPORTS (Sidebar card) ── */
@media (max-width: 1024px) {
    .ai-reports-mini-card {
        max-height: 300px;
    }
}

/* ── 10. GLOBAL BENTO CARD padding nhỏ hơn trên mobile ── */
@media (max-width: 640px) {
    .bento-card {
        padding: 12px !important;
    }
    .bento-card-title {
        font-size: 12px !important;
    }

    /* Hero Director Card: font nhỏ hơn */
    .director-content {
        font-size: 12px !important;
        line-height: 1.55 !important;
    }

    /* Gauge: compact */
    .gauge-score   { font-size: 22px !important; }
    .gauge-status  { font-size: 11px !important; }
    .gauge-card    { min-height: 180px !important; }

    /* Sankey / Quadrant / Word Cloud: giảm height */
    .sankey-svg-wrapper      { height: 150px !important; }
    .quadrant-svg-wrapper    { height: 170px !important; }
    .word-cloud-svg-wrapper  { height: 130px !important; }

    /* Macro chart: giảm height */
    .macro-chart-wrapper { height: 180px !important; }
    .macro-chart-card    { min-height: 220px !important; }

    /* Heatmap: giảm chiều cao */
    .heatmap-container { min-height: 220px !important; }

    /* AI News ticker: giảm height */
    #ai-news-ticker-wrapper  { min-height: 220px !important; }

    /* Inter-market: giảm height từng widget */
    #inter-market-widgets > div { height: 110px !important; }

    /* Section labels: nhỏ hơn */
    .news-section-label {
        font-size: 10px !important;
        letter-spacing: 1px !important;
    }

    /* Earnings list: tăng max-height để không bị cụt */
    .earnings-list { max-height: 260px !important; }

    /* Tab nav: wrap 2 cột */
    .dashboard-tab-nav { flex-wrap: wrap; gap: 4px; }
    .tab-btn { flex: none !important; min-width: calc(50% - 4px) !important; font-size: 11px !important; padding: 8px 10px !important; }
}

/* ── 11. FOMC Countdown: responsive countdown number ── */
@media (max-width: 640px) {
    .data-fomc-card [data-fomc-timer] {
        font-size: 18px !important;
        letter-spacing: 1px !important;
    }
}

/* ── 12. VSA Ticker Bar: font nhỏ hơn ── */
@media (max-width: 640px) {
    .ticker-item      { font-size: 11px !important; }
    .ticker-sym       { font-size: 11px !important; }
}

/* ── 13. Section news (Tin Tức) cards ── */
@media (max-width: 768px) {
    .news-card-row {
        flex-direction: column !important;
    }
    .news-card-thumbnail {
        width: 100% !important;
        height: 160px !important;
    }
}

/* ── 14. AI Reports trong sidebar: scrollable trên mobile ── */
@media (max-width: 1024px) {
    #ai-reports-list {
        max-height: 280px;
        overflow-y: auto;
    }
}

/* ── 15. Bản đồ nhiệt: đảm bảo không tràn ── */
@media (max-width: 640px) {
    #heatmap-dynamic-container {
        min-height: 470px !important;
        overflow: hidden;
    }
}

/* ── 16. Light theme: section label trên nền trắng ── */
body.light-theme .news-section-label {
    border-bottom-color: rgba(0,0,0,0.08);
}

/* ── 17. Đảm bảo không có horizontal scroll ── */
@media (max-width: 768px) {
    .app-container {
        overflow-x: hidden;
        padding: 12px 10px !important;
    }
    .bento-top-nav {
        margin-bottom: 12px !important;
    }
    .news-section {
        margin-bottom: 20px !important;
    }
}

/* === 18. G�C NH�N & QUADRANT COLORS === */
.gold-title { color: #ffd700; }
body.light-theme .gold-title { color: #b45309 !important; font-weight: 800; }
body.light-theme .quadrant-label { text-shadow: none !important; font-weight: 800; }
body.light-theme .quadrant-label.leading { color: #16a34a !important; }
body.light-theme .quadrant-label.weakening { color: #b45309 !important; }
body.light-theme .quadrant-label.improving { color: #0284c7 !important; }
body.light-theme .quadrant-label.lagging { color: #dc2626 !important; }

/* === 19. LIGHT THEME OVERRIDES FOR INLINE STYLES === */
/* Ticker badges in Góc Nhìn STOCK36 */
body.light-theme .news-item-ticker-tag,
body.light-theme #wp-posts-list-v2 span[style*="color: #ffd700"] { 
    color: #b45309 !important; 
    background: rgba(180, 83, 9, 0.1) !important; 
    border-color: rgba(180, 83, 9, 0.3) !important; 
}

/* Links in Góc Nhìn STOCK36 and Radar */
body.light-theme .news-item-title-link,
body.light-theme .radar-item-link,
body.light-theme .radar-news-link,
body.light-theme #wp-posts-list-v2 a,
body.light-theme #butterfly-alert-dropdown a { 
    color: #334155 !important; 
}

body.light-theme .news-item-title-link:hover,
body.light-theme .radar-item-link:hover,
body.light-theme .radar-news-link:hover,
body.light-theme #wp-posts-list-v2 a:hover,
body.light-theme #butterfly-alert-dropdown a:hover { 
    color: #2563eb !important; 
}

/* Gauge Score & VIP Banner */
body.light-theme .gauge-score { 
    color: #b45309 !important; 
}
body.light-theme .premium-widget-inner h3 {
    color: #b45309 !important;
    text-shadow: none !important;
}

/* VSA Ticker Bar 'Hold/Yellow' items */
body.light-theme .ticker-val.hold, 
body.light-theme .ticker-pct.hold,
body.light-theme .ticker-sym span[style*="color: #ffd700"] {
    color: #b45309 !important; 
    background: rgba(180, 83, 9, 0.1) !important;
}

/* Custom height for Corporate News Content based on screen size */
.data-corporate-news-content {
    max-height: 400px; /* Default for mobile/tablets */
}

@media (min-width: 1024px) {
    .data-corporate-news-content {
        max-height: 700px; /* Taller on web screens */
    }
}
@media (min-width: 1440px) {
    .data-corporate-news-content {
        max-height: 900px; /* Even taller on extra large web screens */
    }
}

/* === AVOCADO GREEN LIGHT THEME (XANH BƠ) FOR NEWS.HTML === */

/* Background gradient for news.html */
body.light-theme.page-news .bg-gradient-glow {
    background: radial-gradient(circle at top right, rgba(132, 204, 22, 0.15) 0%, transparent 40%),
                radial-gradient(circle at bottom left, rgba(234, 179, 8, 0.1) 0%, transparent 40%) !important;
    background-color: #fcfef9 !important;
}
body.light-theme.page-news {
    background-color: #fcfef9 !important;
    color: #0f172a !important;
}

/* Bento Cards */
body.light-theme.page-news .bento-card {
    background: #ffffff !important;
    border: 1px solid #d9f99d !important;
    box-shadow: 0 4px 20px rgba(101, 163, 13, 0.05) !important;
}

/* Section titles and icons */
body.light-theme.page-news .bento-card-title {
    color: #15803d !important; /* Deep green */
    border-bottom: 1px solid rgba(132, 204, 22, 0.2) !important;
}
body.light-theme.page-news .card-icon {
    color: #65a30d !important; /* Avocado green */
    text-shadow: none !important;
}

/* Top Nav / Headers */
body.light-theme.page-news .news-section-label {
    color: #4d7c0f !important;
    border-bottom: 2px solid #bef264 !important;
    background: rgba(132, 204, 22, 0.1) !important;
    text-shadow: none !important;
}

/* Tags and Buttons */
body.light-theme.page-news .bento-tab-btn {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #d9f99d !important;
}
body.light-theme.page-news .bento-tab-btn.active {
    background: #84cc16 !important; /* Avocado */
    color: #ffffff !important;
    border-color: #65a30d !important;
    box-shadow: 0 4px 12px rgba(132, 204, 22, 0.3) !important;
}
body.light-theme.page-news .bento-tab-btn:hover:not(.active) {
    background: #ecfccb !important;
}

/* Text and Links */
body.light-theme.page-news .text-muted {
    color: #475569 !important;
}
body.light-theme.page-news a {
    color: #0f172a !important;
}
body.light-theme.page-news a:hover {
    color: #65a30d !important;
}

/* Special Elements */
body.light-theme.page-news .gold-title,
body.light-theme.page-news .quadrant-label.weakening { 
    color: #b45309 !important; /* Brownish-Yellow */
}

/* VIP Banner / Premium Widget */
body.light-theme.page-news .premium-widget {
    background: linear-gradient(145deg, #fefce8 0%, #ffffff 100%) !important;
    border: 1px solid #fef08a !important;
    box-shadow: 0 8px 32px rgba(234, 179, 8, 0.15) !important;
}
body.light-theme.page-news .premium-widget-inner h3 {
    color: #a16207 !important;
    text-shadow: none !important;
}
body.light-theme.page-news .premium-widget-inner p {
    color: #4d7c0f !important;
}
body.light-theme.page-news .btn-copy-script {
    background: rgba(132, 204, 22, 0.1) !important;
    color: #4d7c0f !important;
    border: 1px solid #84cc16 !important;
}
body.light-theme.page-news .btn-copy-script:hover {
    background: #84cc16 !important;
    color: #ffffff !important;
}

/* Market Pulse and general values */
body.light-theme.page-news .market-pulse-val,
body.light-theme.page-news .data-ai-reports-content,
body.light-theme.page-news .data-corporate-news-content {
    color: #1e293b !important;
}

/* Fix link colors in Dark Mode for specific sections */
body:not(.light-theme) .alpha-picks-list a,
body:not(.light-theme) .data-corporate-news-content a {
    color: #38bdf8 !important;
    text-decoration: none;
}
body:not(.light-theme) .alpha-picks-list a:hover,
body:not(.light-theme) .data-corporate-news-content a:hover {
    color: #7dd3fc !important;
    text-decoration: underline;
}

/* === LIGHT THEME OVERRIDES FOR DASHBOARD COMPONENTS === */
body.light-theme .dashboard-tab-nav {
    background: #f1f5f9;
    border-color: #e2e8f0;
}
body.light-theme .tab-btn {
    color: #64748b;
}
body.light-theme .tab-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
body.light-theme .tab-btn.active {
    background: #ffffff;
    color: #16a34a;
    border-color: #bbf7d0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

body.light-theme .gauge-message,
body.light-theme .radar-insight-message {
    color: #475569;
}
body.light-theme .gauge-status {
    color: #1e293b;
}
body.light-theme .gauge-score {
    color: #0f172a !important;
}
body.light-theme .omni-search-results {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
body.light-theme .omni-item-symbol {
    color: #0f172a;
}
body.light-theme .omni-item-name {
    color: #475569;
}
body.light-theme .omni-item:hover {
    background: #f8fafc;
}

/* Fix inline white borders and inline white texts for light theme */
body.light-theme div[style*="rgba(255,255,255,0.05)"],
body.light-theme li[style*="rgba(255,255,255,0.05)"] {
    border-bottom-color: rgba(0,0,0,0.06) !important;
}

body.light-theme .bctc-ticker,
body.light-theme .bctc-ticker-name {
    color: #0f172a !important;
}


/* ==========================================================
   MOBILE UX FIXES: LÃI SUẤT, CPI, SỰ KIỆN KHẨN
   ========================================================== */
@media (max-width: 768px) {
    /* 1. Tăng chiều cao cho biểu đồ Lãi suất và CPI để hiện đủ nhãn */
    .macro-chart-wrapper {
        height: 280px !important;
    }
    #sbv-vnindex-container svg,
    #cpi-overlay-container svg {
        height: 280px !important;
    }

    /* 2. Loại bỏ thanh cuộn lồng nhau cho Dòng Sự Kiện Khẩn & Góc Nhìn STOCK36 */
    #news-grid,
    #wp-posts-list-v2 {
        max-height: none !important;
        overflow-y: visible !important;
        padding-right: 0 !important;
    }

    /* Hiển thị nhiều text hơn cho tin tức trên mobile */
    .news-card-item h2 {
        -webkit-line-clamp: 4 !important;
        font-size: 15px !important;
    }
    .news-card-item p {
        -webkit-line-clamp: 5 !important;
        font-size: 13px !important;
    }
}


/* ============================================================
   DCA SIMULATOR - Mo Phong Tich San
   ============================================================ */
.dca-page-header { padding: 28px 32px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.dca-page-header h1 { font-size: 24px; font-weight: 800; color: #f1f5f9; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.5px; }
.dca-page-header p { font-size: 14.5px; color: #cbd5e1; margin: 8px 0 0 0; max-width: none; line-height: 1.6; }
body.light-theme .dca-page-header h1 { color: #0f172a; }
body.light-theme .dca-page-header p { color: #475569; }
.dca-config-card { padding: 20px 28px 26px; margin: 16px; border-radius: 14px; }

/* ── CONFIG SECTION ── */
.dca-config-card { padding: 20px 32px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.dca-config-section-label { font-size: 11px; font-weight: 700; color: #cbd5e1; letter-spacing: 0.5px; margin-bottom: 12px; }
.dca-tags-input-wrapper { display: flex; flex-wrap: nowrap; overflow-x: auto; align-items: center; gap: 6px; padding: 8px 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: 10px; min-height: 44px; cursor: text; transition: border-color 0.2s; position: relative; scrollbar-width: none; }
.dca-tags-input-wrapper::-webkit-scrollbar { display: none; }
.dca-tags-input-wrapper:focus-within { border-color: rgba(0,230,118,0.4); box-shadow: 0 0 0 3px rgba(0,230,118,0.06); }
body.light-theme .dca-tags-input-wrapper { background: #f8fafc; border-color: #e2e8f0; }

.dca-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px; border: 1.5px solid; color: #fff; cursor: default; user-select: none; animation: dca-tag-in 0.18s ease; flex: 0 0 auto; white-space: nowrap; }
@keyframes dca-tag-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.dca-tag .dca-tag-remove { width: 15px; height: 15px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; cursor: pointer; background: rgba(255,255,255,0.2); border: none; color: inherit; font-family: inherit; flex-shrink: 0; transition: background 0.15s; padding: 0; line-height: 1; }
.dca-tag .dca-tag-remove:hover { background: rgba(255,255,255,0.4); }
.dca-tag-text-input { border: none !important; outline: none !important; background: transparent !important; box-shadow: none !important; color: #e2e8f0; font-size: 13px; font-family: 'Inter', sans-serif; min-width: 120px; flex: 1; padding: 2px 4px; }
.dca-tag-text-input:focus { border: none !important; outline: none !important; background: transparent !important; box-shadow: none !important; }
.dca-tag-text-input::placeholder { color: #94a3b8; }
body.light-theme .dca-tag-text-input { color: #1e293b; background: transparent !important; border: none !important; box-shadow: none !important; outline: none !important; }
body.light-theme .dca-tag-text-input:focus { background: transparent !important; border: none !important; box-shadow: none !important; outline: none !important; }
body.light-theme .dca-tag-text-input::placeholder { color: #94a3b8; }
.dca-autocomplete-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #0f1520; border: 1px solid rgba(255,255,255,0.09); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,0.5); z-index: 9999; max-height: 280px; overflow-y: auto; display: none; }
.dca-autocomplete-dropdown.open { display: block; }
body.light-theme .dca-autocomplete-dropdown { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 16px 40px rgba(0,0,0,0.15); }
.dca-ac-item { display: grid; grid-template-columns: 28% 1fr auto; align-items: center; gap: 24px; padding: 9px 14px; cursor: pointer; font-size: 12px; transition: background 0.12s; border-left: 2px solid transparent; }
.dca-ac-item:hover, .dca-ac-item.active { background: rgba(0,230,118,0.07); border-left-color: #00e676; }
body.light-theme .dca-ac-item:hover { background: rgba(0,150,80,0.05); }
.dca-ac-ticker { font-weight: 700; color: #e2e8f0; text-align: right; }
body.light-theme .dca-ac-ticker { color: #1e293b; }
.dca-ac-name { color: #94a3b8; font-size: 11px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dca-ac-exchange { font-size: 11px; font-weight: 700; padding: 2px 5px; border-radius: 4px; background: rgba(0,230,118,0.1); color: #00e676; }
.dca-params-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.dca-param-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; position: relative; }
.dca-param-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #94a3b8; }
body.light-theme .dca-param-label { color: #94a3b8; }
.dca-param-input { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: 8px; color: #e2e8f0; font-size: 13px; font-family: 'Inter', sans-serif; font-weight: 500; padding: 10px 12px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; width: 100%; box-sizing: border-box; }
.dca-param-input:focus { border-color: rgba(0,230,118,0.4); box-shadow: 0 0 0 3px rgba(0,230,118,0.06); }
.dca-param-input option { background: #0f1520; color: #e2e8f0; }
body.light-theme .dca-param-input { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
body.light-theme .dca-param-input option { background: #ffffff; color: #1e293b; }
.dca-param-hint { position: absolute; top: calc(100% + 4px); left: 2px; font-size: 10.5px; color: #94a3b8; font-weight: 500; }
.dca-simulate-btn { display: flex; align-items: center; gap: 8px; padding: 11px 24px; background: linear-gradient(135deg, #00e676 0%, #00b8d4 100%); border: none; border-radius: 8px; color: #0f1520; font-size: 13px; font-weight: 700; font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,230,118,0.25); flex-shrink: 0; }
.dca-simulate-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,230,118,0.35); }
.dca-simulate-btn:active { transform: translateY(0); }
.dca-simulate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.dca-simulate-btn .btn-spinner { width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.3); border-top-color: #0f1520; border-radius: 50%; animation: dca-spin 0.7s linear infinite; display: none; }
.dca-simulate-btn.loading .btn-spinner { display: block; }
.dca-simulate-btn.loading .btn-icon { display: none; }
@keyframes dca-spin { to { transform: rotate(360deg); } }
.dca-chart-card { padding: 20px 24px; margin: 0 16px 16px; border-radius: 14px; position: relative; }
.dca-chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.dca-chart-title { font-size: 14px; font-weight: 700; color: #e2e8f0; display: flex; align-items: center; gap: 8px; }
body.light-theme .dca-chart-title { color: #1e293b; }
.dca-chart-action-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); border-radius: 7px; color: #cbd5e1; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: 'Inter', sans-serif; }
.dca-chart-action-btn:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
body.light-theme .dca-chart-action-btn { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }
#dca-chart-svg-wrapper { width: 100%; overflow: hidden; border-radius: 8px; }
#dca-chart-svg { width: 100%; display: block; overflow: visible; }
#dca-chart-svg .axis text { font-size: 10px; fill: #94a3b8; font-family: 'Inter', sans-serif; }
body.light-theme #dca-chart-svg .axis text { fill: #94a3b8; }
#dca-chart-svg .axis path, #dca-chart-svg .axis line { stroke: rgba(255,255,255,0.15); }
body.light-theme #dca-chart-svg .axis path, body.light-theme #dca-chart-svg .axis line { stroke: rgba(0,0,0,0.06); }
#dca-chart-svg .grid line { stroke: rgba(255,255,255,0.1); stroke-dasharray: 3,3; }
body.light-theme #dca-chart-svg .grid line { stroke: rgba(0,0,0,0.05); }
.dca-tooltip { position: fixed; background: rgba(15,21,32,0.96); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 14px 16px; font-size: 13px; pointer-events: none; z-index: 9999; display: none; min-width: 240px; backdrop-filter: blur(10px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
body.light-theme .dca-tooltip { background: rgba(255,255,255,0.98); border-color: #e2e8f0; box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.dca-tooltip-date { font-size: 14px; font-weight: 800; color: #f8fafc; margin-bottom: 10px; }
body.light-theme .dca-tooltip-date { color: #0f172a; }
.dca-tooltip-inv { font-size: 13px; color: #cbd5e1; display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
body.light-theme .dca-tooltip-inv { color: #475569; }
.dca-tooltip-inv span { font-size: 14px; opacity: 0.6; }
.dca-tooltip-inv strong { color: #e2e8f0; font-weight: 700; }
body.light-theme .dca-tooltip-inv strong { color: #1e293b; }
.dca-tooltip-divider { border-bottom: 1px dashed rgba(255,255,255,0.2); margin: 0 0 12px 0; }
body.light-theme .dca-tooltip-divider { border-bottom-color: #cbd5e1; }
.dca-tooltip-list { display: flex; flex-direction: column; gap: 8px; }
.dca-tooltip-row { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 0; }
.dca-tooltip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dca-tooltip-label { color: #cbd5e1; flex: 1; }
body.light-theme .dca-tooltip-label { color: #475569; }
.dca-tooltip-val { color: #e2e8f0; font-weight: 700; margin-left: 4px; }
body.light-theme .dca-tooltip-val { color: #0f172a; }
.dca-tooltip-pct { font-weight: 700; margin-left: 6px; }
.dca-chart-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); }
body.light-theme .dca-chart-legend { border-top-color: #e2e8f0; }
.dca-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; cursor: pointer; transition: opacity 0.15s; white-space: nowrap; }
.dca-legend-item:hover { opacity: 0.8; }
.dca-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dca-legend-ticker { font-weight: 700; color: #e2e8f0; }
body.light-theme .dca-legend-ticker { color: #1e293b; }
.dca-table-card { padding: 20px 24px; margin: 0 16px 24px; border-radius: 14px; }
.dca-table-title { font-size: 14px; font-weight: 700; color: #e2e8f0; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
body.light-theme .dca-table-title { color: #1e293b; }
.dca-perf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dca-perf-table thead th { padding: 9px 12px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: #94a3b8; border-bottom: 1px solid rgba(255,255,255,0.15); white-space: nowrap; }
body.light-theme .dca-perf-table thead th { color: #94a3b8; border-bottom-color: #e2e8f0; }
.dca-perf-table thead th.text-right { text-align: right; }
.dca-perf-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.12s; }
.dca-perf-table tbody tr:hover { background: rgba(255,255,255,0.02); }
body.light-theme .dca-perf-table tbody tr { border-bottom-color: #f1f5f9; }
body.light-theme .dca-perf-table tbody tr:hover { background: rgba(0,0,0,0.015); }
.dca-perf-table td { padding: 11px 12px; vertical-align: middle; }
.dca-rank-badge { font-size: 11px; font-weight: 700; color: #94a3b8; width: 32px; text-align: center; }
.dca-rank-badge.rank-1 { color: #ffd700; }
.dca-rank-badge.rank-2 { color: #94a3b8; }
.dca-rank-badge.rank-3 { color: #cd7f32; }
.dca-table-ticker-cell { display: flex; align-items: center; gap: 7px; font-weight: 700; color: #e2e8f0; font-size: 13px; }
body.light-theme .dca-table-ticker-cell { color: #1e293b; }
.dca-table-color-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dca-table-money { text-align: right; color: #cbd5e1; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.light-theme .dca-table-money { color: #64748b; }
.dca-table-money.current-value { color: #e2e8f0; font-weight: 600; }
body.light-theme .dca-table-money.current-value { color: #1e293b; }
.dca-table-pct { text-align: right; font-weight: 700; font-size: 13px; white-space: nowrap; }

/* Theme-aware colors for Profit/Pct/CAGR */
.dca-table-pct.positive, .dca-table-money.positive { color: #00e676; }
.dca-table-pct.negative, .dca-table-money.negative { color: #ef4444; }
.dca-table-pct.neutral,  .dca-table-money.neutral  { color: #94a3b8; }

body.light-theme .dca-table-pct.positive, body.light-theme .dca-table-money.positive { color: #00b84c !important; font-weight: 800; }
body.light-theme .dca-table-pct.negative, body.light-theme .dca-table-money.negative { color: #e63946 !important; font-weight: 800; }
body.light-theme .dca-table-pct.neutral,  body.light-theme .dca-table-money.neutral  { color: #64748b !important; font-weight: 800; }
.dca-table-period { text-align: center; color: #94a3b8; font-size: 11.5px; white-space: nowrap; }
.dca-loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 16px; color: #94a3b8; }
.dca-loading-spinner { width: 40px; height: 40px; border: 3px solid rgba(0,230,118,0.15); border-top-color: #00e676; border-radius: 50%; animation: dca-spin 0.8s linear infinite; }
.dca-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 12px; color: #94a3b8; text-align: center; }
.dca-empty-icon { font-size: 48px; opacity: 0.5; }
.dca-empty-title { font-size: 16px; font-weight: 700; color: #cbd5e1; }
.dca-empty-desc { font-size: 13px; color: #94a3b8; max-width: 480px; line-height: 1.6; }
@media (max-width: 768px) {
    .dca-page-header { padding: 20px 16px 16px; }
    .dca-config-card { margin: 12px; padding: 16px; }
    .dca-chart-card { margin: 0 12px 12px; padding: 16px; }
    .dca-table-card { margin: 0 12px 20px; padding: 16px; }
    .dca-params-row { gap: 24px 12px; } /* Đủ chỗ cho absolute hint không bị đè */
    .dca-param-group { min-width: 120px; }
    .dca-simulate-btn { width: 100%; justify-content: center; }
}
