/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f0f3fc;
    --bg-secondary: #f8faff;
    --card: #ffffff;
    --text: #080e1f;
    --text-secondary: #5a6282;
    --text-muted: #9ba3c4;
    --accent: #4f46e5;
    --accent-2: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent-glow: rgba(79, 70, 229, 0.15);
    --accent-light: rgba(79, 70, 229, 0.08);
    --positive: #059669;
    --positive-bg: rgba(5, 150, 105, 0.08);
    --positive-border: rgba(5, 150, 105, 0.2);
    --negative: #dc2626;
    --negative-bg: rgba(220, 38, 38, 0.08);
    --negative-border: rgba(220, 38, 38, 0.2);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --border: rgba(10, 14, 40, 0.07);
    --border-strong: rgba(10, 14, 40, 0.12);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 16px 48px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(79,70,229,0.1), 0 24px 48px rgba(0,0,0,0.08);
    --shadow-accent: 0 8px 32px rgba(79,70,229,0.25);
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --radius-pill: 100px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --nav-h: 64px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.82; }

/* ========== LAYOUT ========== */
.app-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ========== NAVIGATION ========== */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-h);
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
    height: 100%;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}

.nav-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: var(--shadow-accent);
    flex-shrink: 0;
}

.nav-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(79,70,229,0.25);
    box-shadow: 0 0 0 3px var(--accent-light);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.16s, color 0.16s;
    white-space: nowrap;
}

.nav-link:hover { background: var(--accent-light); color: var(--text); opacity: 1; }
.nav-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.nav-link.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 2px;
    box-shadow: 0 0 0 3px var(--accent-light);
}

.nav-link-icon { font-size: 0.92rem; line-height: 1; }

.nav-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    border: none;
    font-family: var(--font);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); opacity: 1; }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-accent);
}
.btn-primary:hover { box-shadow: 0 12px 40px rgba(79,70,229,0.35); color: white; }

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }

.btn-danger { background: var(--negative-bg); color: var(--negative); border: 1px solid var(--negative-border); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.77rem; }
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }

/* ========== PORTFOLIO HERO ========== */
.portfolio-hero {
    position: relative;
    background: linear-gradient(135deg, #0f0c29 0%, #2d1b69 40%, #1a1038 80%, #0d1b2a 100%);
    border-radius: var(--radius);
    padding: 44px 40px;
    margin-bottom: 28px;
    overflow: hidden;
    color: white;
}

.portfolio-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 80% at 10% 120%, rgba(99,102,241,0.35) 0%, transparent 50%),
        radial-gradient(ellipse 60% 60% at 90% -20%, rgba(139,92,246,0.25) 0%, transparent 50%);
    pointer-events: none;
}

.portfolio-hero-content { position: relative; z-index: 1; text-align: center; }

.portfolio-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.portfolio-value {
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.82) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portfolio-change {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.portfolio-change.positive { background: rgba(5,150,105,0.2); color: #6ee7b7; border: 1px solid rgba(5,150,105,0.3); }
.portfolio-change.negative { background: rgba(220,38,38,0.2); color: #fca5a5; border: 1px solid rgba(220,38,38,0.3); }

/* ========== VIEW TOGGLE ========== */
.view-toggle-bar { display: flex; justify-content: center; margin-bottom: 20px; }

.view-toggle {
    display: flex;
    background: var(--card);
    border-radius: var(--radius-pill);
    padding: 4px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.view-toggle-btn {
    padding: 8px 24px;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.16s;
}

.view-toggle-btn.active { background: var(--text); color: white; box-shadow: var(--shadow-sm); }

/* ========== CONTROLS BAR ========== */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.tab-group {
    display: flex;
    background: var(--card);
    border-radius: var(--radius-pill);
    padding: 4px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-group::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 7px 18px;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-size: 0.81rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.16s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn.active { background: var(--accent-gradient); color: white; box-shadow: 0 2px 8px rgba(79,70,229,0.3); }

.filter-group { display: flex; gap: 8px; align-items: center; }

.filter-group select {
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-size: 0.81rem;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

/* ========== STOCK LIST ========== */
.stock-list { display: flex; flex-direction: column; gap: 7px; }

.stock-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 13px 18px 13px 21px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.stock-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--border-strong);
    transition: background 0.16s;
}

.stock-item.item-positive::before { background: var(--positive); }
.stock-item.item-negative::before { background: var(--negative); }

.stock-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: rgba(79,70,229,0.14);
    color: var(--text);
}

.stock-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.stock-logo {
    width: 42px; height: 42px;
    border-radius: 12px;
    object-fit: contain;
    background: var(--bg);
    padding: 5px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.stock-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
    color: white;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.stock-info h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 230px;
}

.stock-info .stock-meta { font-size: 0.74rem; color: var(--text-muted); font-weight: 500; }

.stock-middle { display: flex; align-items: center; gap: 10px; }

.stock-right { text-align: right; min-width: 108px; flex-shrink: 0; }
.stock-right .stock-value { font-size: 0.92rem; font-weight: 700; letter-spacing: -0.3px; }

/* ========== PILLS & BADGES ========== */
.rec-pill {
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.rec-level-5 { background: #dcfce7; color: #15803d; border-color: rgba(21,128,61,0.18); }
.rec-level-4 { background: #ecfccb; color: #4d7c0f; border-color: rgba(77,124,15,0.18); }
.rec-level-3 { background: #fef3c7; color: #b45309; border-color: rgba(180,83,9,0.18); }
.rec-level-2 { background: #fee2e2; color: #b91c1c; border-color: rgba(185,28,28,0.18); }
.rec-level-1 { background: #fecaca; color: #7f1d1d; border-color: rgba(127,29,29,0.22); }

[data-theme="dark"] .rec-level-5 { background: rgba(34,197,94,0.18); color: #86efac; border-color: rgba(34,197,94,0.38); }
[data-theme="dark"] .rec-level-4 { background: rgba(132,204,22,0.18); color: #bef264; border-color: rgba(132,204,22,0.38); }
[data-theme="dark"] .rec-level-3 { background: rgba(234,179,8,0.2); color: #fde68a; border-color: rgba(234,179,8,0.4); }
[data-theme="dark"] .rec-level-2 { background: rgba(239,68,68,0.18); color: #fca5a5; border-color: rgba(239,68,68,0.38); }
[data-theme="dark"] .rec-level-1 { background: rgba(239,68,68,0.28); color: #fecaca; border-color: rgba(239,68,68,0.55); }

.thesis-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.thesis-dot.ok { background: var(--positive); box-shadow: 0 0 6px rgba(5,150,105,0.4); }
.thesis-dot.warning { background: var(--warning); box-shadow: 0 0 6px rgba(217,119,6,0.4); }
.thesis-dot.broken { background: var(--negative); box-shadow: 0 0 6px rgba(220,38,38,0.4); }
.thesis-dot.unknown { background: var(--text-muted); }

.return-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
}

.return-badge.positive { background: var(--positive-bg); color: var(--positive); border: 1px solid var(--positive-border); }
.return-badge.negative { background: var(--negative-bg); color: var(--negative); border: 1px solid var(--negative-border); }

/* ========== FLASH MESSAGES ========== */
.flash-msg {
    background: var(--accent-light);
    color: var(--accent);
    padding: 12px 20px;
    border-radius: var(--radius-xs);
    margin-bottom: 16px;
    font-size: 0.86rem;
    font-weight: 500;
    border: 1px solid rgba(79,70,229,0.15);
}

/* ========== BACK LINK ========== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-weight: 500;
    margin-bottom: 22px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--card);
    transition: all 0.16s;
}

.back-link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); opacity: 1; }

/* ========== DETAIL HERO ========== */
.detail-hero {
    position: relative;
    background: linear-gradient(135deg, #0f0c29 0%, #1e1b4b 40%, #1a1038 80%, #0d1b2a 100%);
    border-radius: var(--radius);
    padding: 40px 40px 36px;
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-bottom: 24px;
    overflow: hidden;
    color: white;
}

.detail-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 70% at 20% 110%, rgba(99,102,241,0.3) 0%, transparent 55%),
        radial-gradient(ellipse 50% 50% at 85% -10%, rgba(139,92,246,0.2) 0%, transparent 55%);
    pointer-events: none;
}

.detail-hero-content { position: relative; z-index: 1; }

.detail-logo {
    width: 60px; height: 60px;
    border-radius: 18px;
    object-fit: contain;
    background: rgba(255,255,255,0.12);
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 12px;
    backdrop-filter: blur(8px);
}

.detail-company-name { font-size: 1.1rem; font-weight: 700; color: rgba(255,255,255,0.95); margin-bottom: 4px; }
.detail-meta { font-size: 0.79rem; color: rgba(255,255,255,0.42); font-weight: 500; margin-bottom: 16px; }

.detail-price {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.78) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-price-currency { font-size: 1.2rem; font-weight: 500; -webkit-text-fill-color: rgba(255,255,255,0.55); }

.detail-change-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.detail-change-row .return-badge {
    padding: 6px 16px;
    font-size: 0.84rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.14);
    color: white;
    backdrop-filter: blur(8px);
}

.detail-change-row .return-badge.positive { background: rgba(5,150,105,0.2); border-color: rgba(5,150,105,0.3); color: #6ee7b7; }
.detail-change-row .return-badge.negative { background: rgba(220,38,38,0.2); border-color: rgba(220,38,38,0.3); color: #fca5a5; }

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 20px 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.16s;
}

.stat-card:hover { border-color: rgba(79,70,229,0.15); box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.5px; }

/* ========== CHART CARD ========== */
.chart-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.chart-card canvas { width: 100% !important; height: 280px !important; }

.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.chart-header h3 { font-size: 0.94rem; font-weight: 700; }

.time-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    padding: 3px;
    border: 1px solid var(--border);
}

.time-tab {
    padding: 5px 14px;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.16s;
}

.time-tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-xs); }

/* ========== SECTION CARDS ========== */
.section-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.section-card h3 { font-size: 0.94rem; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }

/* ========== SCORE TABLE ========== */
.score-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.score-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.71rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--border);
}

.score-table td { padding: 11px 12px; font-size: 0.86rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.score-table tr:last-child td { border-bottom: none; }
.score-table tbody tr:hover td { background: var(--bg-secondary); }

.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 0.77rem;
    padding: 0 7px;
}

.score-pos { background: var(--positive-bg); color: var(--positive); border: 1px solid var(--positive-border); }
.score-neg { background: var(--negative-bg); color: var(--negative); border: 1px solid var(--negative-border); }
.score-neu { background: var(--warning-bg); color: var(--warning); }
.score-na { background: var(--bg); color: var(--text-muted); }

/* ========== THESIS ========== */
.thesis-text {
    background: var(--accent-light);
    border-radius: var(--radius-xs);
    padding: 16px 20px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    border-left: 3px solid var(--accent);
    line-height: 1.65;
}

.thesis-checks { display: flex; flex-direction: column; gap: 8px; }

.thesis-check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
}

.thesis-check-row.ok { background: var(--positive-bg); border-color: var(--positive-border); }
.thesis-check-row.warning { background: var(--warning-bg); border-color: rgba(217,119,6,0.15); }
.thesis-check-row.broken { background: var(--negative-bg); border-color: var(--negative-border); }
.thesis-check-row.unknown { background: var(--bg); border-color: var(--border); }

.thesis-check-row .check-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.thesis-check-row .check-label { font-weight: 600; font-size: 0.85rem; }
.thesis-check-row .check-details { font-size: 0.79rem; color: var(--text-secondary); margin-top: 2px; }

/* ========== FUNDAMENTALS ========== */
.fundamentals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 24px; }

.fundamental-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.fundamental-item:last-child { border-bottom: none; }
.f-label { font-size: 0.82rem; color: var(--text-secondary); }
.f-value { font-size: 0.86rem; font-weight: 600; }

/* ========== NEWS SECTION ========== */
.news-movement-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.movement-explanation {
    background: linear-gradient(135deg, #f0f4ff, #f5f0ff);
    border-radius: var(--radius-xs);
    padding: 18px 22px;
    font-size: 0.9rem;
    color: var(--text);
    border-left: 3px solid var(--accent);
    line-height: 1.65;
    margin-bottom: 20px;
    min-height: 60px;
    position: relative;
    overflow: hidden;
}
.movement-explanation p { margin: 0 0 12px; }
.movement-explanation p:last-child { margin-bottom: 0; }
.movement-explanation ol,
.movement-explanation ul {
    margin: 4px 0 14px;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.movement-explanation li { padding-left: 4px; }
.movement-explanation li::marker { color: var(--accent); font-weight: 700; }
.movement-explanation strong { color: var(--text); font-weight: 700; }
.movement-explanation code {
    background: var(--accent-light);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.84em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.movement-explanation.loading { background: var(--bg); }
.movement-explanation.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: shimmer-slide 1.5s infinite;
}

@keyframes shimmer-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.news-list { display: flex; flex-direction: column; gap: 0; }

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.14s;
}

.news-item:last-child { border-bottom: none; }
.news-item:hover .news-title { color: var(--accent); }

.news-thumb { width: 64px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--bg); flex-shrink: 0; }

.news-thumb-placeholder {
    width: 64px; height: 46px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.news-content { flex: 1; min-width: 0; }
.news-title { font-size: 0.86rem; font-weight: 600; line-height: 1.4; margin-bottom: 4px; transition: color 0.14s; }
.news-meta { font-size: 0.73rem; color: var(--text-muted); font-weight: 500; }

/* ========== ANALYST SECTION ========== */
.analyst-section { margin-bottom: 24px; }

.rating-bar-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }

.rating-bar {
    display: flex;
    height: 10px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    gap: 2px;
}

.rating-bar-segment { height: 100%; border-radius: 2px; transition: opacity 0.16s; min-width: 4px; }
.rating-bar-segment:hover { opacity: 0.8; }

.rating-counts { display: flex; justify-content: space-between; margin-top: 6px; }

.rating-count { text-align: center; font-size: 0.77rem; }
.rating-count-num { font-weight: 700; display: block; }
.rating-count-label { color: var(--text-muted); font-size: 0.68rem; }

.price-target-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }

.price-target-item { text-align: center; background: var(--bg); border-radius: var(--radius-xs); padding: 12px 8px; border: 1px solid var(--border); }
.price-target-item .pt-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.price-target-item .pt-value { font-size: 1rem; font-weight: 700; }
.price-target-item.pt-mean { background: var(--accent-light); border-color: rgba(79,70,229,0.15); }
.price-target-item.pt-mean .pt-value { color: var(--accent); }

.analyst-changes { display: flex; flex-direction: column; gap: 6px; }

.analyst-change-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    gap: 12px;
}

.analyst-firm { font-size: 0.84rem; font-weight: 600; }
.analyst-grade-change { display: flex; align-items: center; gap: 6px; font-size: 0.79rem; }

.grade-badge { padding: 3px 9px; border-radius: var(--radius-pill); font-size: 0.71rem; font-weight: 700; }
.grade-upgrade { background: var(--positive-bg); color: var(--positive); border: 1px solid var(--positive-border); }
.grade-downgrade { background: var(--negative-bg); color: var(--negative); border: 1px solid var(--negative-border); }
.grade-neutral { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

.analyst-date { font-size: 0.73rem; color: var(--text-muted); white-space: nowrap; }

/* ========== SKELETON LOADER ========== */
.skeleton {
    background: linear-gradient(90deg, var(--bg) 25%, rgba(255,255,255,0.85) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line { height: 13px; margin-bottom: 8px; border-radius: 4px; }

/* ========== DETAIL ACTIONS ========== */
.detail-actions { display: flex; gap: 12px; margin-top: 24px; margin-bottom: 48px; flex-wrap: wrap; }

/* ========== FORM PAGE ========== */
.form-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    max-width: 720px;
}

.form-card h1 { font-size: 1.3rem; font-weight: 800; margin-bottom: 28px; letter-spacing: -0.5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }

.form-group label { display: block; font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--card);
    transition: all 0.16s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.form-group textarea { resize: vertical; min-height: 80px; }

.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 6px; }

.tag-grid label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-xs); font-size: 0.83rem; cursor: pointer; transition: all 0.14s; border: 1px solid transparent; }
.tag-grid label:hover { background: var(--accent-light); border-color: rgba(79,70,229,0.15); }
.tag-grid input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); }

fieldset { border: 1.5px solid var(--border-strong); border-radius: var(--radius-xs); padding: 18px; margin-bottom: 18px; }
fieldset legend { font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); padding: 0 8px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ========== TRENDING PAGE ========== */
.trending-hero {
    position: relative;
    background: linear-gradient(135deg, #1a0533 0%, #2d1b69 35%, #1e3a5f 70%, #0d1b2a 100%);
    border-radius: var(--radius);
    padding: 48px 40px 40px;
    margin-bottom: 32px;
    overflow: hidden;
    color: white;
}

.trending-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 5% 100%, rgba(245,101,48,0.2) 0%, transparent 50%),
        radial-gradient(ellipse 70% 60% at 95% 10%, rgba(124,58,237,0.25) 0%, transparent 55%);
    pointer-events: none;
}

.trending-hero-content { position: relative; z-index: 1; }

.trending-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,101,48,0.15);
    border: 1px solid rgba(245,101,48,0.3);
    color: #fdba74;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
}

.trending-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.72) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trending-hero p { font-size: 0.94rem; color: rgba(255,255,255,0.52); max-width: 560px; line-height: 1.65; }

/* LLM Search */
.llm-search-wrap {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-bottom: 32px;
}

.llm-search-wrap h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.llm-search-wrap p { font-size: 0.84rem; color: var(--text-secondary); margin-bottom: 18px; }

.llm-search-form { display: flex; gap: 10px; flex-wrap: wrap; }

.llm-search-input {
    flex: 1;
    min-width: 220px;
    padding: 13px 20px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-size: 0.94rem;
    color: var(--text);
    background: var(--bg);
    transition: all 0.16s;
    font-weight: 500;
}

.llm-search-input:focus { outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-glow); }
.llm-search-input::placeholder { color: var(--text-muted); }

#llm-result { margin-top: 24px; display: none; }

.llm-result-card { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }

.llm-result-header {
    background: var(--accent-gradient);
    padding: 20px 24px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.llm-result-ticker { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; }
.llm-result-name { font-size: 0.84rem; opacity: 0.72; margin-top: 2px; }
.llm-result-price { text-align: right; }
.llm-result-price-val { font-size: 1.4rem; font-weight: 700; }
.llm-result-price-chg { font-size: 0.81rem; opacity: 0.7; }

.llm-result-body { background: var(--card); padding: 24px; }

.llm-verdict {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.llm-summary { font-size: 0.9rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 20px; }

.llm-key-insight {
    background: linear-gradient(135deg, #f0f4ff, #f5f0ff);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    padding: 14px 18px;
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 20px;
}

.bull-bear-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.bull-bear-col h4 { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px; }
.bull-col h4 { color: var(--positive); }
.bear-col h4 { color: var(--negative); }

.bull-bear-col ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }

.bull-bear-col li {
    font-size: 0.83rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}

.bull-bear-col li::before { content: '•'; flex-shrink: 0; font-weight: 700; margin-top: 1px; }
.bull-col li::before { color: var(--positive); }
.bear-col li::before { color: var(--negative); }

.spec-meter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--bg);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

.spec-meter-label { font-size: 0.77rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

.spec-meter-bar {
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, var(--positive) 0%, var(--warning) 50%, var(--negative) 100%);
    border-radius: 4px;
    position: relative;
}

.spec-meter-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px; height: 16px;
    background: white;
    border: 2px solid var(--text);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: left 0.5s cubic-bezier(0.4,0,0.2,1);
}

.spec-meter-val { font-size: 0.77rem; font-weight: 700; white-space: nowrap; }

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.spinner {
    width: 22px; height: 22px;
    border: 2.5px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.trending-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.trending-section-header h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.3px; }
.trending-section-header .badge-updated { font-size: 0.72rem; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); padding: 4px 12px; border-radius: var(--radius-pill); }

.trending-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

.trending-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
}

.trending-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: rgba(79,70,229,0.15); }

.trending-card-header { padding: 20px 20px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.trending-card-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.trending-ticker-badge { font-size: 0.71rem; font-weight: 800; letter-spacing: 0.08em; background: var(--accent-gradient); color: white; padding: 3px 10px; border-radius: var(--radius-pill); flex-shrink: 0; }

.trending-company-name { font-size: 0.87rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.trending-price-block { text-align: right; flex-shrink: 0; }
.trending-price { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px; }
.trending-chg { font-size: 0.8rem; font-weight: 700; }
.trending-chg.positive { color: var(--positive); }
.trending-chg.negative { color: var(--negative); }

.trending-card-body { padding: 0 20px 20px; flex: 1; display: flex; flex-direction: column; gap: 14px; }

.trending-rationale { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.65; }

.trending-catalyst {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: linear-gradient(135deg, #f0f4ff, #f5f0ff);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    font-size: 0.81rem;
    color: var(--text);
    border-left: 3px solid var(--accent);
}

.trending-catalyst-label { font-weight: 700; color: var(--accent); white-space: nowrap; }

.trending-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.trending-score-item { text-align: center; background: var(--bg); border-radius: var(--radius-xs); padding: 10px 6px; border: 1px solid var(--border); }
.trending-score-val { font-size: 1.3rem; font-weight: 800; display: block; letter-spacing: -0.5px; }
.trending-score-label { font-size: 0.63rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-top: 2px; }

.trending-investor-type { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 0.71rem; font-weight: 700; text-transform: capitalize; letter-spacing: 0.03em; }

.type-groei { background: rgba(99,102,241,0.1); color: #4f46e5; border: 1px solid rgba(99,102,241,0.2); }
.type-waarde { background: rgba(5,150,105,0.1); color: #059669; border: 1px solid rgba(5,150,105,0.2); }
.type-speculatief { background: rgba(245,101,48,0.1); color: #ea580c; border: 1px solid rgba(245,101,48,0.2); }
.type-inkomen { background: rgba(217,119,6,0.1); color: #d97706; border: 1px solid rgba(217,119,6,0.2); }

.trending-card-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg-secondary); }

.trending-risk { font-size: 0.76rem; color: var(--text-muted); flex: 1; }
.trending-risk strong { color: var(--negative); }

.trending-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; background: var(--card); border-radius: var(--radius); border: 2px dashed var(--border); color: var(--text-secondary); }
.trending-empty h3 { font-size: 1.1rem; margin-bottom: 8px; }
.trending-empty p { font-size: 0.87rem; }

/* ========== BRIEFING PAGE ========== */
.briefing-hero {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 40%, #047857 70%, #059669 100%);
    border-radius: var(--radius);
    padding: 48px 40px;
    margin-bottom: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.briefing-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.briefing-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 10px;
}
.briefing-hero h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 10px; }
.briefing-hero p { font-size: 1rem; opacity: 0.85; max-width: 540px; line-height: 1.5; margin-bottom: 16px; }
.briefing-hero-meta { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; opacity: 0.7; }
.briefing-meta-sep { opacity: 0.4; }

.briefing-oordeel-banner {
    border: 1px solid;
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.briefing-oordeel-left { display: flex; align-items: center; gap: 16px; flex: 1; }
.briefing-oordeel-badge {
    border: 1px solid;
    border-radius: var(--radius-pill);
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.briefing-headline { font-size: 0.95rem; font-weight: 600; color: var(--text); line-height: 1.4; margin: 0; }
.briefing-oordeel-right { text-align: right; }
.briefing-portfolio-val { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.briefing-portfolio-chg { font-size: 0.82rem; font-weight: 600; margin-top: 2px; }

.briefing-top-row { display: grid; grid-template-columns: 360px 1fr; gap: 20px; margin-bottom: 32px; }

/* Passief inkomen kaart */
.briefing-income-card {
    background: linear-gradient(145deg, #064e3b, #065f46);
    border-radius: var(--radius);
    padding: 28px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.briefing-income-header { display: flex; align-items: center; gap: 12px; }
.briefing-income-icon { font-size: 1.8rem; }
.briefing-income-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; }
.briefing-income-sublabel { font-size: 0.8rem; opacity: 0.6; }
.briefing-income-numbers { }
.briefing-income-main { display: flex; align-items: baseline; gap: 6px; }
.briefing-income-amount { font-size: 2.8rem; font-weight: 800; letter-spacing: -2px; }
.briefing-income-period { font-size: 1rem; opacity: 0.6; }
.briefing-income-monthly { font-size: 0.88rem; opacity: 0.75; margin-top: 2px; }
.briefing-income-breakdown { display: flex; flex-direction: column; gap: 8px; }
.briefing-income-row { display: grid; grid-template-columns: 70px 1fr 72px; align-items: center; gap: 8px; }
.briefing-income-ticker { font-size: 0.75rem; font-weight: 700; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.briefing-income-bar-wrap { height: 5px; background: rgba(255,255,255,0.15); border-radius: 10px; overflow: hidden; }
.briefing-income-bar { height: 100%; background: rgba(255,255,255,0.7); border-radius: 10px; transition: width 0.6s ease; }
.briefing-income-amount-sm { font-size: 0.72rem; opacity: 0.75; text-align: right; }
.briefing-income-empty { font-size: 0.82rem; opacity: 0.65; font-style: italic; line-height: 1.5; }
.briefing-income-tip { font-size: 0.78rem; opacity: 0.75; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 14px; line-height: 1.5; }

/* Samenvatting kaart */
.briefing-summary-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.briefing-summary-header { display: flex; align-items: center; gap: 10px; }
.briefing-summary-icon { font-size: 1.3rem; }
.briefing-summary-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.briefing-summary-text { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; margin: 0; }
.briefing-focus-box {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    padding: 10px 14px;
    font-size: 0.83rem;
    color: var(--text);
    line-height: 1.5;
}
.briefing-focus-label { font-weight: 700; color: var(--accent); margin-right: 6px; }
.briefing-quick-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 4px; }
.briefing-qstat { text-align: center; background: var(--bg); border-radius: var(--radius-xs); padding: 12px 8px; border: 1px solid var(--border); }
.briefing-qstat-val { display: block; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.briefing-qstat-label { display: block; font-size: 0.63rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }

/* Actie Plan */
.briefing-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.briefing-section-header h2 { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.briefing-badge-ai { background: var(--accent-light); color: var(--accent); border: 1px solid rgba(79,70,229,0.2); border-radius: var(--radius-pill); padding: 3px 10px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.briefing-section-sub { font-size: 0.8rem; color: var(--text-muted); }
.briefing-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.briefing-action-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.briefing-action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.briefing-action-header { display: flex; align-items: center; justify-content: space-between; }
.briefing-action-type {
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-size: 0.71rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.briefing-action-urgentie { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.urgentie-hoog { color: #dc2626; }
.urgentie-normaal { color: #d97706; }
.urgentie-laag { color: var(--text-muted); }
.briefing-action-ticker { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.briefing-action-naam { font-size: 0.8rem; color: var(--text-secondary); margin-top: -6px; }
.briefing-action-rationale { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.55; margin: 0; flex: 1; }
.briefing-action-btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: var(--radius-xs);
    border: 1px solid;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.15s;
    align-self: flex-start;
}
.briefing-action-btn:hover { opacity: 0.75; }

/* Ranking table */
.briefing-ranking-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 40px;
}
.briefing-ranking-table { width: 100%; border-collapse: collapse; }
.briefing-ranking-table thead th {
    padding: 12px 16px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.briefing-ranking-table thead th.align-right { text-align: right; }
.briefing-ranking-row {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
}
.briefing-ranking-row:last-child { border-bottom: none; }
.briefing-ranking-row:hover { background: var(--accent-light); }
.briefing-ranking-table td { padding: 12px 16px; font-size: 0.86rem; }
.briefing-ranking-table td.align-right { text-align: right; }
.briefing-rank-num { width: 48px; }
.rank-medal, .rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
}
.rank-medal.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-medal.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); color: #fff; }
.rank-medal.bronze { background: linear-gradient(135deg, #c2856c, #a96846); color: #fff; }
.rank-num { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.briefing-rank-name { font-weight: 600; color: var(--text); font-size: 0.88rem; }
.briefing-rank-ticker { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.briefing-score-wrap { display: flex; align-items: center; gap: 8px; }
.briefing-score-bar-bg { flex: 1; height: 5px; background: var(--border); border-radius: 10px; overflow: hidden; max-width: 80px; }
.briefing-score-bar { height: 100%; border-radius: 10px; transition: width 0.4s ease; }
.briefing-score-val { font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.briefing-rec-badge { padding: 3px 10px; border-radius: var(--radius-pill); font-size: 0.69rem; font-weight: 700; }
.briefing-value { font-weight: 600; color: var(--text); }

/* ========== FOOTER ========== */
.app-footer { text-align: center; padding: 36px 0; font-size: 0.75rem; color: var(--text-muted); margin-top: 16px; border-top: 1px solid var(--border); }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 64px 24px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.empty-state p { color: var(--text-secondary); margin-bottom: 20px; font-size: 0.95rem; }

/* ========== LOADING BAR ========== */
.loading-bar { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--accent), #a855f7, var(--accent)); background-size: 200% 100%; animation: shimmer 1.2s infinite; z-index: 999; display: none; }
.loading-bar.active { display: block; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== UTILITY ========== */
.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }

/* ========== ICON COLORS ========== */
.icon-blue { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.icon-purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.icon-green { background: linear-gradient(135deg, #059669, #10b981); }
.icon-red { background: linear-gradient(135deg, #dc2626, #ef4444); }
.icon-orange { background: linear-gradient(135deg, #ea580c, #f97316); }
.icon-teal { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.icon-pink { background: linear-gradient(135deg, #db2777, #ec4899); }
.icon-indigo { background: linear-gradient(135deg, #4338ca, #6366f1); }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .portfolio-value { font-size: 2.4rem; }
    .trending-grid { grid-template-columns: 1fr; }
    .bull-bear-grid { grid-template-columns: 1fr; }
    .price-target-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .app-container { padding: 0 16px; }
    .nav-inner { padding: 0 16px; }
    .portfolio-hero { padding: 32px 20px; }
    .portfolio-value { font-size: 2rem; letter-spacing: -1px; }
    .detail-hero { padding: 28px 20px; }
    .detail-price { font-size: 2.2rem; }

    .stock-item { grid-template-columns: 1fr auto; grid-template-rows: auto auto; }
    .stock-middle { grid-column: 1 / -1; justify-content: flex-start; }

    .controls-bar { flex-direction: column; align-items: stretch; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .trending-hero h1 { font-size: 1.8rem; }
    .trending-hero { padding: 32px 20px; }
    .llm-search-form { flex-direction: column; }
}

@media (max-width: 480px) {
    .stock-icon, .stock-logo { width: 38px; height: 38px; }
    .stock-icon { font-size: 0.65rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .portfolio-value { font-size: 1.8rem; }
    .price-target-row { grid-template-columns: repeat(2, 1fr); }
}

/* ========== THEME TOGGLE BUTTON ========== */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border-strong);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text);
    transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
    flex-shrink: 0;
    padding: 0;
    box-shadow: var(--shadow-xs);
}
.theme-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}
.theme-toggle .theme-toggle-icon {
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    line-height: 1;
}
.theme-toggle:hover .theme-toggle-icon { transform: rotate(-18deg); }

/* ========== DARK MODE ========== */
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

[data-theme="dark"] {
    --bg: #0a0d1a;
    --bg-secondary: #11152a;
    --card: #171c35;
    --text: #eef1f9;
    --text-secondary: #a7afcf;
    --text-muted: #6f7699;
    --accent: #818cf8;
    --accent-2: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-glow: rgba(129, 140, 248, 0.28);
    --accent-light: rgba(129, 140, 248, 0.14);
    --positive: #34d399;
    --positive-bg: rgba(52, 211, 153, 0.14);
    --positive-border: rgba(52, 211, 153, 0.3);
    --negative: #f87171;
    --negative-bg: rgba(248, 113, 113, 0.14);
    --negative-border: rgba(248, 113, 113, 0.3);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.14);
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.35);
    --shadow: 0 2px 8px rgba(0,0,0,0.35), 0 8px 32px rgba(0,0,0,0.45);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 16px 48px rgba(0,0,0,0.5);
    --shadow-hover: 0 8px 24px rgba(129, 140, 248, 0.25), 0 24px 48px rgba(0,0,0,0.45);
    --shadow-accent: 0 8px 32px rgba(99, 102, 241, 0.45);
}

[data-theme="dark"] body {
    background:
        radial-gradient(ellipse 80% 60% at 10% -10%, rgba(99,102,241,0.12) 0%, transparent 55%),
        radial-gradient(ellipse 60% 60% at 95% 110%, rgba(139,92,246,0.1) 0%, transparent 55%),
        var(--bg);
}

[data-theme="dark"] .top-nav {
    background: rgba(14, 17, 34, 0.78);
    border-bottom-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .movement-explanation,
[data-theme="dark"] .llm-key-insight,
[data-theme="dark"] .trending-catalyst {
    background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(139,92,246,0.1));
    color: var(--text);
}

[data-theme="dark"] .movement-explanation.loading { background: var(--bg-secondary); }
[data-theme="dark"] .movement-explanation.loading::after {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(255,255,255,0.06) 50%, var(--bg-secondary) 75%);
}

[data-theme="dark"] .grade-neutral {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .view-toggle-btn.active {
    background: var(--accent-gradient);
    color: #fff;
}

[data-theme="dark"] .type-groei { background: rgba(129,140,248,0.15); color: #c7d2fe; border-color: rgba(129,140,248,0.3); }
[data-theme="dark"] .type-waarde { background: rgba(52,211,153,0.14); color: #6ee7b7; border-color: rgba(52,211,153,0.3); }
[data-theme="dark"] .type-speculatief { background: rgba(251,146,60,0.14); color: #fdba74; border-color: rgba(251,146,60,0.3); }
[data-theme="dark"] .type-inkomen { background: rgba(251,191,36,0.14); color: #fcd34d; border-color: rgba(251,191,36,0.3); }

[data-theme="dark"] .urgentie-hoog { color: #f87171; }
[data-theme="dark"] .urgentie-normaal { color: #fbbf24; }

[data-theme="dark"] .spec-meter-thumb {
    background: #fff;
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

[data-theme="dark"] .btn-secondary {
    background: var(--card);
    border-color: var(--border-strong);
}
[data-theme="dark"] .btn-secondary:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .filter-group select {
    background: var(--card);
    color: var(--text);
    border-color: var(--border-strong);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--card);
    color: var(--text);
    border-color: var(--border-strong);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--text-muted); }

[data-theme="dark"] .news-thumb,
[data-theme="dark"] .news-thumb-placeholder {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255,255,255,0.04);
    border-color: var(--border-strong);
}
[data-theme="dark"] .theme-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}
