/* ==========================================================
   Stock Advisor — Design System
   Based on Figma design tokens
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
    --nav-bg: #0f172a;
    --nav-border: #1e293b;
    --nav-text: #cad5e2;
    --nav-active: #155dfc;
    --nav-active-shadow: 0 4px 6px rgba(21,93,252,0.25), 0 2px 4px rgba(21,93,252,0.25);
    --page-bg: #f8f9fc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.1);
    --card-radius: 16px;
    --heading: #1a1d29;
    --body: #475569;
    --muted: #94a3b8;
    --primary: #155dfc;
    --primary-hover: #2b7fff;
    --green: #007a55;
    --green-bg: #ecfdf5;
    --green-border: #a4f4cf;
    --red: #e7000b;
    --red-bg: #fef2f2;
    --red-border: #ffc9c9;
    --amber: #bb4d00;
    --amber-bg: #fffbeb;
    --input-bg: #f8fafc;
    --banner-gradient: linear-gradient(135deg, #0f172a, #1e293b);
    --nav-shadow: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.1);

    /* Category icon backgrounds */
    --cat-blue: #eff6ff;
    --cat-green: #ecfdf5;
    --cat-purple: #f5f3ff;
    --cat-slate: #f1f5f9;
    --cat-amber: #fffbeb;
    --cat-purple-alt: #faf5ff;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overscroll-behavior: none; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--body);
    background: var(--page-bg);
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Navigation --- */
.navbar {
    background: var(--nav-bg);
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 56px;
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--nav-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-right: 24px;
    flex-shrink: 0;
}
.navbar-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2b7fff, #155dfc);
    display: flex;
    align-items: center;
    justify-content: center;
}
.navbar-brand-icon svg {
    width: 18px;
    height: 18px;
    fill: white;
}
.navbar-brand-text {
    font-weight: 600;
    font-size: 16.8px;
    color: white;
    letter-spacing: -0.42px;
}
.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-link {
    color: var(--nav-text);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}
.nav-link.active {
    color: white;
    background: var(--nav-active);
    box-shadow: var(--nav-active-shadow);
}
.nav-link svg, .nav-link-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-right a, .nav-right button {
    color: var(--nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
}
.nav-right a:hover, .nav-right button:hover {
    color: white;
    text-decoration: none;
}

/* Hamburger (mobile only) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    border-radius: 8px;
}
.menu-toggle:hover { background: rgba(255,255,255,0.08); }

/* --- Page Layout --- */
.main {
    max-width: 1042px;
    margin: 0 auto;
    padding: 89px 24px 40px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.page-title {
    font-size: 24px;
    font-weight: 500;
    color: var(--heading);
    line-height: 36px;
}
.page-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--body);
    line-height: 20px;
    margin-top: 4px;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.card-icon svg { width: 20px; height: 20px; }
.card-icon-blue { background: var(--cat-blue); color: var(--primary); }
.card-icon-green { background: var(--cat-green); color: var(--green); }
.card-icon-purple { background: var(--cat-purple-alt); color: #7c3aed; }
.card-icon-amber { background: var(--cat-amber); color: var(--amber); }
.card-icon-slate { background: var(--cat-slate); color: var(--body); }
.card-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--heading);
    line-height: 16px;
}
.card-subtitle {
    font-size: 14px;
    color: var(--body);
}
.card-header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    height: 44px;
    transition: background 0.15s;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-secondary {
    background: var(--page-bg);
    color: var(--heading);
    border: 1px solid var(--card-border);
}
.btn-secondary:hover { background: #eef2f7; color: var(--heading); }
.btn-sm {
    height: 36px;
    padding: 8px 12px;
    font-size: 13px;
}
.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--body);
    margin-bottom: 8px;
    line-height: 20px;
}
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--heading);
    background: var(--input-bg);
    height: 44px;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,93,252,0.15);
}
.form-input::placeholder { color: var(--body); }

/* Form Help */
.form-help {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
}
.form-help-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-help-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.form-message {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
}

/* --- Messages --- */
.message {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}
.message-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}
.message-error {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
}
.message-info {
    background: var(--cat-blue);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.message-warning {
    background: var(--amber-bg);
    color: var(--amber);
    border: 1px solid #fcd34d;
}

/* --- Tables --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--cat-slate);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    color: var(--heading);
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.data-table .ticker {
    font-weight: 600;
    color: var(--primary);
}

/* --- Helper Utilities --- */
.text-positive { color: var(--green) !important; }
.text-negative { color: var(--red) !important; }
.text-muted { color: var(--muted); }
.text-heading { color: var(--heading); }
.small { font-size: 12px; color: var(--muted); }
.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }

/* --- Change Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
.badge-positive {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}
.badge-negative {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
}
.badge-info {
    background: var(--cat-blue);
    color: var(--primary);
}
.badge-latest {
    background: var(--cat-blue);
    color: var(--primary);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 500;
}

/* --- Two Column Layout --- */
.two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

/* --- Help Text --- */
.help-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--body);
}
.help-text svg { width: 14px; height: 14px; flex-shrink: 0; }
.help-row {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

/* ==========================================================
   LOGIN PAGE
   ========================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--banner-gradient);
}
.login-card {
    background: white;
    border-radius: var(--card-radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--heading);
    text-align: center;
    margin-bottom: 8px;
}
.login-subtitle {
    color: var(--body);
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}
.login-btn { width: 100%; }

/* ==========================================================
   PORTFOLIO PAGE
   ========================================================== */

/* YTD Performance Banner */
.perf-banner {
    background: var(--banner-gradient);
    border-radius: var(--card-radius);
    padding: 24px;
    margin-bottom: 24px;
    color: white;
}
.perf-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.perf-banner-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.perf-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.perf-banner-icon svg { width: 20px; height: 20px; }
.perf-banner-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.perf-banner-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}
/* Page Header Meta (As of date) */
.page-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}
.refresh-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
}
.refresh-btn:hover { background: rgba(255,255,255,0.18); }
.refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.perf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.perf-item {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.perf-label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.perf-value {
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.perf-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
    font-weight: 500;
}
.perf-positive { color: #4ade80; }
.perf-negative { color: #f87171; }
.perf-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

/* Perf banner aliases (used by portfolio template) */
.perf-banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.perf-banner-item {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.perf-banner-label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.perf-banner-value {
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.perf-banner-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
    font-weight: 500;
}
.perf-banner-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}
.ytd-positive, .perf-banner-value.ytd-positive { color: #4ade80; }
.ytd-negative, .perf-banner-value.ytd-negative { color: #f87171; }

/* Stat Cards (3-column) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon-blue { background: var(--cat-blue); color: var(--primary); }
.stat-icon-purple { background: var(--cat-purple-alt); color: #7c3aed; }
.stat-icon-amber { background: var(--cat-amber); color: var(--amber); }
.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--heading);
}

/* Stat Card Icon variants (used by portfolio template) */
.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-icon svg { width: 20px; height: 20px; }
.stat-card-icon-blue { background: var(--cat-blue); }
.stat-card-icon-purple { background: var(--cat-purple-alt); }
.stat-card-icon-amber { background: var(--cat-amber); }
.stat-card-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--heading);
}
.stat-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Accordion Sections */
.accordion { margin-bottom: 24px; }
.accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 8px;
    overflow: hidden;
}
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 20px 24px;
    user-select: none;
    transition: background 0.15s;
}
.accordion-header:hover { background: #fafbfc; }
.accordion-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--heading);
    display: flex;
    align-items: center;
    gap: 12px;
}
.accordion-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
    display: flex;
    align-items: center;
    gap: 12px;
}
.accordion-chevron {
    width: 20px;
    height: 20px;
    color: var(--muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.accordion-header.expanded .accordion-chevron {
    transform: rotate(180deg);
}
.accordion-body {
    display: none;
    padding: 0 24px 24px;
}
.accordion-body.show { display: block; }

/* Collapsible Sections (Portfolio) */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 20px 0;
    user-select: none;
}
.collapsible-header::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
    margin-right: 12px;
    transition: transform 0.2s;
    transform: rotate(-90deg);
}
.collapsible-header.expanded::before {
    transform: rotate(0deg);
}
.collapsible-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--heading);
    flex: 1;
}
.collapsible-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}
.collapsible-content {
    display: none;
    padding-bottom: 16px;
}
.collapsible-content.show {
    display: block;
}

/* Holdings Table (inside accordion) */
.holdings-row { cursor: pointer; }
.holdings-row:hover { background: #f1f5f9 !important; }
.holdings-row.expanded { background: #eef2f7 !important; }
.holdings-row td:first-child::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    font-size: 10px;
    color: var(--muted);
    transition: transform 0.15s;
}
.holdings-row.expanded td:first-child::before {
    transform: rotate(90deg);
}
.detail-row { display: none; }
.detail-row.show { display: table-row; }
.detail-row td {
    background: #f8f9fc;
    padding: 16px 16px 16px 28px;
    border-bottom: 1px solid var(--card-border);
}
.detail-content {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    font-size: 13px;
}
.detail-item {
    display: flex;
    gap: 6px;
}
.detail-label { color: var(--muted); }
.detail-value { color: var(--heading); font-weight: 500; }

/* Live Quote Inline */
.live-quote {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--card-border);
}
.live-quote-loading { color: var(--muted); font-style: italic; font-size: 13px; }
.live-quote-error { color: var(--red); font-size: 13px; }
.live-quote-data {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 13px;
}
.quote-price { font-weight: 600; color: var(--heading); }
.quote-change { font-weight: 500; }
.quote-positive { color: var(--green); }
.quote-negative { color: var(--red); }
.quote-neutral { color: var(--muted); }

/* View Report Button */
.btn-view-report {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    height: 40px;
    margin-top: 12px;
    transition: background 0.15s;
}
.btn-view-report:hover { background: var(--primary-hover); color: white; text-decoration: none; }

/* Hidden holdings (show more) */
.holdings-hidden { display: none !important; }
.show-more-holdings {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}
.btn-show-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--page-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-show-more:hover {
    background: #eff6ff;
    border-color: var(--primary);
}
.btn-show-more svg { flex-shrink: 0; }

/* Inline Holding Charts */
.holding-chart-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--card-border);
}
.holding-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.holding-chart-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--heading);
}
.holding-chart-controls {
    display: flex;
    gap: 6px;
}
.chart-period-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: var(--page-bg);
    color: var(--body);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
}
.chart-period-btn:hover {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}
.chart-period-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(21, 93, 252, 0.25);
}
.holding-chart-container {
    position: relative;
    height: 150px;
    width: 100%;
}
.holding-chart-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}
.holding-chart-container.loading::after {
    content: 'Loading chart...';
    color: var(--muted);
    font-size: 13px;
    font-style: italic;
}
.holding-chart-container.loading canvas {
    opacity: 0.3;
}
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    font-size: 13px;
}

/* Sector Breakdown */
.sector-list { list-style: none; }
.sector-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
    gap: 16px;
    font-size: 14px;
}
.sector-item:last-child { border-bottom: none; }
.sector-name { flex: 1; color: var(--heading); font-weight: 500; }
.sector-count { font-weight: 600; color: var(--body); }
.sector-eur {
    font-weight: 700;
    color: var(--heading);
    min-width: 80px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.sector-pct {
    font-weight: 600;
    color: var(--body);
    min-width: 60px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Weekly Performance Movers */
.small-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--heading);
    margin-bottom: 16px;
}
.mover-list { list-style: none; }
.mover-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 14px;
    gap: 12px;
}
.mover-item:last-child { border-bottom: none; }
.mover-ticker {
    font-weight: 600;
    color: var(--primary);
    min-width: 80px;
}
.mover-name {
    color: var(--body);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mover-change {
    font-weight: 700;
    min-width: 70px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.mover-eur {
    min-width: 90px;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.mover-date {
    min-width: 90px;
    color: var(--body);
    font-size: 13px;
}
.mover-days {
    min-width: 80px;
    text-align: right;
    color: var(--primary);
    font-weight: 600;
}

/* --- Movers Section (Figma card-based layout) --- */
.movers-section { margin-bottom: 8px; }
.movers-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.movers-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.movers-icon-green { background: var(--green-bg); }
.movers-icon-red { background: var(--red-bg); }
.movers-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
}
.movers-title-green { color: var(--green); }
.movers-title-red { color: var(--red); }
.movers-count {
    font-size: 13px;
    color: var(--muted);
    font-weight: 400;
}
.movers-divider {
    height: 1px;
    background: var(--card-border);
    margin: 16px 0;
}
.movers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.mover-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--page-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    gap: 8px;
}
.mover-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.mover-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mover-card-icon span {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}
.mover-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mover-card-ticker {
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
}
.mover-card-name {
    font-size: 13px;
    color: var(--body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mover-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}
.mover-card-pct {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.mover-card-eur {
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* --- Dividend Table --- */
.dividend-income-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    border-radius: 10px;
    margin-bottom: 16px;
}
.dividend-income-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.dividend-income-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--body);
    flex: 1;
}
.dividend-income-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
    font-variant-numeric: tabular-nums;
}
.dividend-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.dividend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.dividend-table thead th {
    background: #f1f5f9;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.dividend-table thead th.num { text-align: right; }
.dividend-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--body);
    white-space: nowrap;
}
.dividend-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.dividend-table tbody td.ticker-link {
    font-weight: 600;
    color: var(--primary);
}
.dividend-table tbody td.income-value {
    font-weight: 600;
    color: var(--green);
}
.date-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.days-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.days-badge-urgent {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}

/* ==========================================================
   STOCK ADVISOR PAGE
   ========================================================== */

/* Already covered by .two-col, .card, .form-*, .btn-* */

/* Advisor two-column layout */
.advisor-layout {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 24px;
    align-items: start;
}
.advisor-main { min-width: 0; }
.advisor-sidebar { min-width: 0; }

/* Success actions (after report generated) */
.success-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.success-actions .btn { min-width: 140px; }

/* Loading indicator */
.loading {
    display: none;
    color: var(--muted);
    font-style: italic;
    margin-top: 12px;
}

/* ==========================================================
   REPORTS PAGE
   ========================================================== */

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 24px;
}
.search-bar input {
    width: 100%;
    height: 44px;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--heading);
    background: var(--input-bg);
}
.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,93,252,0.15);
}
.search-bar input::placeholder { color: var(--body); }
.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
}

/* Report Search Bar */
.report-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 12px 20px;
    margin-bottom: 24px;
    position: relative;
}
.report-search-icon {
    flex-shrink: 0;
}
.report-search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--heading);
    outline: none;
    padding: 0;
    height: 24px;
}
.report-search-input::placeholder { color: var(--muted); }
.report-search-count {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.report-search-count::before {
    content: '';
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 2h5l4 4v8a1 1 0 01-1 1H4a1 1 0 01-1-1V3a1 1 0 011-1z' stroke='%2394a3b8' stroke-width='1.3'/%3E%3Cpath d='M9 2v4h4' stroke='%2394a3b8' stroke-width='1.3'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

/* Report Category Section */
.report-category {
    margin-bottom: 24px;
}
.report-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.report-category-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.report-category-icon svg { width: 18px; height: 18px; }
.report-category-title {
    font-size: 16.8px;
    font-weight: 600;
    color: var(--heading);
    letter-spacing: -0.42px;
    flex: 1;
}
.report-category-count {
    font-size: 14px;
    color: var(--body);
}

/* Report Items */
.report-list { list-style: none; }
.report-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
    gap: 12px;
}
.report-item:last-child { border-bottom: none; }
.report-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.report-item-icon svg { width: 14px; height: 14px; }
.report-info { flex: 1; min-width: 0; }
.report-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.report-name:hover { text-decoration: underline; }
.report-date {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}
.report-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.report-btn {
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.report-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.report-view {
    background: var(--primary);
    color: white;
}
.report-view:hover { background: var(--primary-hover); color: white; text-decoration: none; }
.report-btn.report-download {
    background: var(--page-bg);
    color: var(--heading);
    border: 1px solid var(--card-border);
}
.report-btn.report-download:hover { background: #eef2f7; text-decoration: none; }

/* Report icon-small, badges, counts */
.report-icon-small {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}
.report-icon-small.card-icon-blue { background: var(--cat-blue); color: #155dfc; }
.report-icon-small.card-icon-green { background: var(--cat-green); color: #007a55; }
.report-icon-small.card-icon-purple { background: var(--cat-purple); color: #7c3aed; }
.report-icon-small.card-icon-slate { background: var(--cat-slate); color: #475569; }
.report-icon-small.card-icon-amber { background: var(--cat-amber); color: #bb4d00; }

.report-latest-badge {
    background: var(--cat-blue);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-left: auto;
    white-space: nowrap;
}
.report-latest-badge:hover { background: #dbeafe; text-decoration: none; }

.report-count {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}
.report-empty {
    color: var(--muted);
    font-size: 14px;
    padding: 16px 0;
}

.report-category-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

/* Larger View/Download buttons */
.btn-view, .btn-download {
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    height: 40px;
    display: inline-flex;
    align-items: center;
}
.btn-view { background: var(--primary); color: white; }
.btn-view:hover { background: var(--primary-hover); color: white; text-decoration: none; }
.btn-download { background: var(--page-bg); color: var(--heading); border: 1px solid var(--card-border); }
.btn-download:hover { background: #eef2f7; text-decoration: none; }

/* Hidden report items (show more toggle) */
.report-item-hidden { display: none; }

/* Show More Button */
.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 10px;
}
.show-more-btn:hover { background: var(--cat-blue); }
.show-more-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}
.show-more-btn.expanded svg { transform: rotate(180deg); }

/* ==========================================================
   PRECIOUS METALS PAGE
   ========================================================== */

/* PM Total Value Badge */
.pm-total-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}
.pm-total-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: var(--green-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pm-total-icon svg { width: 16px; height: 16px; }

/* Spot Price Grid */
.spot-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.spot-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 16px;
}
.spot-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.spot-icon {
    width: 40px;
    height: 40px;
    border-radius: 16px;
    background: var(--cat-amber);
    display: flex;
    align-items: center;
    justify-content: center;
}
.spot-icon svg { width: 20px; height: 20px; color: var(--amber); }
.spot-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--heading);
}
.spot-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

/* Spot Card Redesign */
.spot-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.spot-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--heading);
    background: var(--cat-amber);
    border-radius: 8px;
    padding: 4px 10px;
    min-width: 36px;
}
.spot-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.spot-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.spot-badge-positive {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}
.spot-badge-negative {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
}

/* Spot Card Interactive */
.spot-card { cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.spot-card:hover { border-color: var(--primary); }
.spot-card-active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.spot-chart-hint {
    font-size: 11px;
    color: var(--primary);
    margin-top: 8px;
    font-weight: 500;
    opacity: 0.7;
}
.spot-card:hover .spot-chart-hint { opacity: 1; }

/* Holdings + Allocation Side-by-Side */
.pm-holdings-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}
.pm-holdings-card { min-width: 0; }
.pm-allocation-card { min-width: 0; }
@media (max-width: 900px) {
    .pm-holdings-layout {
        grid-template-columns: 1fr;
    }
}

/* Allocation Bars */
.alloc-item { margin-bottom: 20px; }
.alloc-item:last-child { margin-bottom: 0; }
.alloc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.alloc-name { font-size: 14px; font-weight: 500; color: var(--heading); }
.alloc-pct { font-size: 14px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.alloc-bar-bg {
    height: 8px;
    background: var(--page-bg);
    border-radius: 4px;
    overflow: hidden;
}
.alloc-bar {
    height: 100%;
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.6s ease;
}
.alloc-bar-gold { background: #f59e0b; }
.alloc-bar-silver { background: #3b82f6; }
.alloc-bar-mining { background: #6366f1; }

/* Chart Fullscreen */
.chart-fullscreen {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow: auto;
}
.chart-fullscreen #chart-container { height: calc(100vh - 200px) !important; }

/* Chart Select Dropdowns */
.form-select-sm {
    padding: 6px 28px 6px 12px;
    font-size: 13px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--heading);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}
.form-select-sm:focus { outline: none; border-color: var(--primary); }

/* Allocation Sidebar (legacy) */
.metals-layout {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 24px;
    align-items: start;
}

/* Option type badges */
.option-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.option-type-call { background: var(--green-bg); color: #166534; }
.option-type-put { background: var(--red-bg); color: #991b1b; }

/* Expandable options rows */
.options-row { cursor: pointer; }
.options-row:hover { background: #f1f5f9 !important; }
.options-row.expanded { background: #eef2f7 !important; }
.options-row td:first-child::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    font-size: 10px;
    color: var(--muted);
    transition: transform 0.15s;
}
.options-row.expanded td:first-child::before { transform: rotate(90deg); }
.option-detail-row { display: none; }
.option-detail-row.show { display: table-row; }
.option-detail-row td {
    background: #f8f9fc;
    padding: 16px 16px 16px 28px;
    border-bottom: 1px solid var(--card-border);
}
.option-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.option-detail-section {
    background: white;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
}
.option-detail-section h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--card-border);
}
.option-metric {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}
.option-metric-label { color: var(--body); }
.option-metric-value {
    font-weight: 600;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}
.option-metric-value.positive { color: var(--green); }
.option-metric-value.negative { color: var(--red); }
.moneyness-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.moneyness-itm { background: var(--green-bg); color: #166534; }
.moneyness-otm { background: var(--amber-bg); color: #92400e; }
.moneyness-atm { background: #e0e7ff; color: #3730a3; }
.option-detail-loading {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* Table scroll wrapper for mobile */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================
   REPORT PANEL (Floating Progress)
   ========================================================== */
.report-panel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 10000;
    font-family: inherit;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.report-panel-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.95);
}
.report-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.report-panel-title { font-size: 14px; font-weight: 600; color: #e0e0e0; }
.report-panel-controls { display: flex; align-items: center; gap: 8px; }
.report-panel-count { font-size: 12px; color: var(--muted); }
.report-panel-minimize {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--muted);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.report-panel-minimize:hover { background: rgba(255,255,255,0.2); color: #fff; }
.report-panel-body { max-height: 400px; overflow-y: auto; padding: 8px; }
.report-job {
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.3s ease;
}
.report-job:last-child { margin-bottom: 0; }
.report-job-completed { border-color: rgba(52, 199, 89, 0.3); animation: jobComplete 1s ease; }
@keyframes jobComplete {
    0%, 50% { background: rgba(52, 199, 89, 0.15); }
    100% { background: rgba(255,255,255,0.04); }
}
.report-job-error { border-color: rgba(255, 69, 58, 0.3); }
.report-job-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.report-job-ticker { font-weight: 600; font-size: 14px; color: #fff; }
.report-job-time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.report-job-stage { font-size: 12px; color: #a0a0a5; margin-bottom: 6px; }
.report-job-progress { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.report-job-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #bf5af2);
    border-radius: 2px;
    transition: width 0.5s ease;
}
.report-job-progress-bar-done { background: #34c759; }
.report-job-progress-bar-error { background: #ff453a; }
.report-job-actions { display: flex; gap: 8px; margin-top: 8px; }
.report-job-actions a {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}
.report-job-btn-view { background: var(--primary); color: #fff; }
.report-job-btn-view:hover { background: var(--primary-hover); }
.report-job-btn-download { background: rgba(255,255,255,0.1); color: #e0e0e0; }
.report-job-btn-download:hover { background: rgba(255,255,255,0.2); }
.report-job-btn-dismiss {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: auto;
}
.report-job-btn-dismiss:hover { background: rgba(255,255,255,0.1); color: #fff; }
.report-panel-collapsed {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: opacity 0.3s ease;
    font-size: 18px;
}
.report-panel-collapsed:hover { background: #1e293b; }
.report-panel-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}
.report-panel-queued { color: #ffd60a; }

/* ==========================================================
   RESPONSIVE — Tablet (≤768px)
   ========================================================== */
@media (max-width: 768px) {
    /* Navigation */
    .navbar {
        flex-wrap: wrap;
        padding: 0 16px;
        height: auto;
        min-height: 52px;
    }
    .navbar-brand { margin-right: auto; padding: 10px 0; }
    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 4px;
        padding-bottom: 12px;
    }
    .nav-links.show { display: flex; }
    .nav-link {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 10px;
        height: 44px;
    }
    .nav-right {
        display: none;
        width: 100%;
        padding: 8px 0 12px;
        border-top: 1px solid rgba(255,255,255,0.1);
        flex-direction: column;
    }
    .nav-right.show { display: flex; }
    .nav-right a { display: block; padding: 12px 16px; height: 44px; }

    /* Layout */
    .main { padding: 72px 16px 32px; max-width: 100%; }
    .page-title { font-size: 20px; margin-bottom: 16px; }
    .card { padding: 16px; border-radius: 12px; margin-bottom: 16px; }
    .two-col { grid-template-columns: 1fr; }
    .advisor-layout { grid-template-columns: 1fr; }
    .metals-layout { grid-template-columns: 1fr; }

    /* Stats & Grids */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .spot-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .perf-grid { grid-template-columns: 1fr; gap: 16px; }
    .perf-banner-grid { grid-template-columns: 1fr; gap: 12px; }
    .perf-banner-value { font-size: 24px; }

    /* Hide positions card on mobile */
    .hide-mobile { display: none !important; }
    .stats-grid { grid-template-columns: 1fr 1fr; }

    /* Tables */
    .data-table th, .data-table td { padding: 10px 8px; font-size: 13px; }
    .data-table .ticker { font-size: 13px; }
    .data-table .num { font-size: 12px; }
    .data-table .shares-col { display: none; }
    .data-table .hide-small { display: none; }

    /* Holdings table overflow */
    #holdings-table { width: 100%; table-layout: auto; }

    /* Detail panels */
    .detail-row td { padding: 12px; }
    .detail-content { flex-direction: column; gap: 8px; }
    .option-detail-grid { grid-template-columns: 1fr; }

    /* Inline charts mobile */
    .holding-chart-header { flex-wrap: wrap; gap: 8px; }
    .holding-chart-container { height: 130px; }
    .chart-period-btn { min-width: 36px; height: 32px; font-size: 13px; padding: 0 10px; }

    /* Report panel */
    .report-panel { right: 10px; width: 280px; top: auto; bottom: 70px; transform: none; }
    .report-panel-hidden { transform: scale(0.95); }
    .report-panel-collapsed { right: 10px; top: auto; bottom: 70px; transform: none; }

    /* Movers (old list) */
    .mover-item { flex-wrap: wrap; }
    .mover-name { order: 3; width: 100%; margin-top: 4px; }
    .mover-eur { display: none; }

    /* Movers (new card grid) */
    .movers-grid { grid-template-columns: 1fr; }
    .mover-card { padding: 12px; }
    .mover-card-name { max-width: 120px; }

    /* Dividend table */
    .dividend-table { font-size: 13px; }
    .dividend-table thead th,
    .dividend-table tbody td { padding: 8px 6px; }

    /* Report items */
    .report-item { flex-wrap: wrap; gap: 8px; }
    .report-info { width: calc(100% - 50px); }
    .report-actions { width: 100%; margin-top: 8px; }

    /* Forms */
    .form-input { font-size: 16px; /* prevents iOS zoom */ }
    .btn-group { flex-direction: column; gap: 10px; }
    .btn-group .btn { width: 100%; }

    /* Table scroll */
    .table-scroll-wrapper { margin: 0 -16px; padding: 0 16px; }
    .pm-options-table .hide-mobile-secondary { display: none; }
}

/* ==========================================================
   RESPONSIVE — Phone (≤480px)
   ========================================================== */
@media (max-width: 480px) {
    .navbar { padding: 0 12px; }
    .navbar-brand-text { font-size: 14px; }
    .main { padding: 68px 12px 24px; }
    .page-title { font-size: 18px; }
    .card { padding: 14px; border-radius: 10px; }
    .stats-grid { gap: 8px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 16px; }
    .stat-label { font-size: 11px; }
    .spot-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 4px; }
    .data-table .weight-col { display: none; }
    .perf-value { font-size: 24px; }
    .login-card { padding: 24px 20px; margin: 16px; border-radius: 12px; }
    .login-title { font-size: 20px; }
    .message { padding: 12px; font-size: 13px; max-height: 200px; }
    .pm-holdings-table .hide-small { display: none; }
    .table-scroll-wrapper { margin: 0 -14px; padding: 0 14px; }
}

/* Touch-friendly */
@media (hover: none) and (pointer: coarse) {
    .holdings-row:hover { background: transparent; }
    .holdings-row:active { background: var(--cat-blue); }
    .options-row:hover { background: transparent; }
    .options-row:active { background: var(--cat-blue); }
    .nav-link:hover { background: transparent; }
    .nav-link:active { background: rgba(255,255,255,0.1); }
    .btn:hover { transform: none; }
    .btn:active { opacity: 0.8; }
}

/* Mobile-only elements (hidden on desktop) */
.mobile-only { display: none; }
@media (max-width: 768px) {
    .mobile-only { display: flex !important; }
}

/* Trades Table */
.trades-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.trades-table th {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 2px solid var(--card-border);
    font-weight: 600;
    color: var(--heading);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.trades-table td { padding: 12px 10px; border-bottom: 1px solid var(--card-border); color: var(--heading); }
.trades-table tbody tr:nth-child(even) { background: #fafbfc; }
.trades-table .num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.trades-table .action-buy { color: var(--green); font-weight: 500; }
.trades-table .action-sell { color: var(--red); font-weight: 500; }
@media (max-width: 700px) {
    .trades-table { font-size: 12px; }
    .trades-table th, .trades-table td { padding: 6px 4px; }
}

/* ============================================================
   Portfolio Analytics Styles
   Matches existing design tokens from main.css
   ============================================================ */

/* Analytics Section Container */
#analytics-section {
    margin-bottom: 24px;
}

#analytics-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

#analytics-content {
    display: none;
}




/* Chart Containers */
.analytics-chart-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--heading);
    margin: 0;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* Timeline Chart in Collapsible Section */
.timeline-chart-container {
    height: 320px;
    margin: 16px 0;
}

.chart-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 14px;
}

/* Timeline Legend */
.timeline-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.legend-dot {
    border-radius: 50%;
    display: inline-block;
}

/* Sector Chart Container */
.sector-chart-container {
    height: 320px;
}

/* Analytics Grid Layout */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* Position History Modal */
#position-history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.position-history-modal-content {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.position-history-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    line-height: 1;
}

.position-history-close:hover {
    color: var(--heading);
}

.position-history-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.position-history-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--heading);
}

.position-history-range {
    font-size: 13px;
    color: var(--muted);
}

.position-history-chart-container {
    height: 200px;
    margin-bottom: 20px;
}

.position-history-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}

.position-history-stats .stat-item {
    text-align: center;
}

.position-history-stats .stat-label {
    font-size: 12px;
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
}

.position-history-stats .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--heading);
}

.loading-text {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

/* Responsive Adjustments */
@media (max-width: 600px) {

    .position-history-stats {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .position-history-stats .stat-item {
        text-align: left;
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid var(--card-border);
    }

    .position-history-stats .stat-item:last-child {
        border-bottom: none;
    }
}

/* Benchmark Toggle Styles */
.timeline-legend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 12px;
}

.benchmark-toggles {
    display: flex;
    gap: 16px;
    align-items: center;
}

.benchmark-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--muted);
    user-select: none;
}

.benchmark-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

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

.benchmark-toggle-label {
    font-weight: 500;
}

.benchmark-toggle:hover {
    color: var(--heading);
}

@media (max-width: 600px) {
    .timeline-legend-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .benchmark-toggles {
        width: 100%;
        justify-content: flex-start;
    }
}


/* ==========================================================
   MOBILE RESPONSIVE FIXES (2024)
   Phase 1: Critical, Phase 2: Visual, Phase 3: Polish
   ========================================================== */

/* --- Sticky First Column for Tables --- */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.table-sticky-col th:first-child,
.table-sticky-col td:first-child {
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

.table-sticky-col thead th:first-child {
    background: var(--cat-slate);
    z-index: 3;
}

.table-sticky-col tbody tr:hover td:first-child {
    background: #f8fafc;
}

/* Ensure minimum width for scrollable tables */
.table-scroll-wrapper .data-table,
.table-scroll-wrapper .dividend-table,
.table-scroll-wrapper .trades-table {
    min-width: 600px;
}

/* ==========================================================
   PHASE 1: CRITICAL FIXES
   ========================================================== */

/* --- Page Header Mobile Fix --- */
@media (max-width: 480px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .page-header-meta {
        font-size: 12px;
    }
}

/* --- Performance Banner Mobile (375px) --- */
@media (max-width: 400px) {
    .perf-banner {
        padding: 16px;
    }

    .perf-banner-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .perf-banner-header-left {
        width: 100%;
    }

    .refresh-btn {
        width: 100%;
        justify-content: center;
    }

    .perf-banner-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .perf-banner-item {
        padding: 10px 12px;
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 0 12px;
        align-items: center;
        text-align: left;
    }

    .perf-banner-item .perf-banner-label {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
    }

    .perf-banner-item .perf-banner-value {
        grid-column: 3;
        grid-row: 1;
        text-align: right;
    }

    .perf-banner-item .perf-banner-sub {
        grid-column: 3;
        grid-row: 2;
        text-align: right;
    }

    .perf-banner-label {
        margin-bottom: 0;
        font-size: 11px;
    }

    .perf-banner-value {
        font-size: 20px;
    }

    .perf-banner-sub {
        font-size: 12px;
        margin-top: 2px;
    }

    .perf-banner-title {
        font-size: 12px;
    }

    .perf-banner-subtitle {
        font-size: 13px;
    }
}

/* --- Table Improvements for Mobile --- */
@media (max-width: 768px) {
    /* Ensure all portfolio tables are scrollable with sticky first col */
    .data-table {
        min-width: 500px;
    }

    /* Smaller padding on table cells for mobile */
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    /* Hide less important columns progressively */
    .data-table .hide-tablet {
        display: none;
    }
}

@media (max-width: 480px) {
    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    /* More aggressive column hiding on phones */
    .data-table .hide-phone {
        display: none;
    }

    .data-table .ticker {
        font-size: 12px;
        min-width: 60px;
    }

    .data-table .num {
        font-size: 11px;
    }
}

/* --- Dividend Table Mobile --- */
@media (max-width: 768px) {
    .dividend-table {
        min-width: 580px;
    }

    .dividend-table thead th,
    .dividend-table tbody td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .dividend-table .hide-tablet {
        display: none;
    }
}

/* --- Options Table Mobile --- */
@media (max-width: 768px) {
    .pm-options-table {
        min-width: 650px;
    }

    .pm-options-table th,
    .pm-options-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
}

/* ==========================================================
   PHASE 2: VISUAL IMPROVEMENTS
   ========================================================== */

/* --- Stats Grid Single Column on Small Phones --- */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px 16px;
    }

    .stat-card-icon {
        width: 36px;
        height: 36px;
    }

    .stat-card-value {
        font-size: 16px;
    }

    .stat-card-label {
        font-size: 10px;
    }
}

/* --- Report Actions Mobile Layout --- */
@media (max-width: 480px) {
    .report-item {
        padding: 12px 0;
    }

    .report-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .report-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 8px;
        font-size: 12px;
    }

    .report-btn svg {
        display: none;
    }

    .report-info {
        width: 100%;
    }

    .report-name {
        font-size: 13px;
    }

    .report-date {
        font-size: 11px;
    }

    .report-icon-small {
        display: none;
    }
}

/* --- Movers Card Adjustments --- */
@media (max-width: 480px) {
    .mover-card {
        padding: 10px 12px;
    }

    .mover-card-left {
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .mover-card-icon {
        width: 32px;
        height: 32px;
    }

    .mover-card-icon span {
        font-size: 12px;
    }

    .mover-card-name {
        max-width: none;
        white-space: normal;
        line-height: 1.3;
        font-size: 11px;
    }

    .mover-card-ticker {
        font-size: 13px;
    }

    .mover-card-pct {
        font-size: 13px;
    }

    .mover-card-eur {
        font-size: 11px;
    }

    .mover-card-right {
        min-width: 60px;
    }
}

/* --- Advisor Layout Spacing --- */
@media (max-width: 768px) {
    .advisor-layout {
        gap: 16px;
    }

    .advisor-main .card,
    .advisor-sidebar .card {
        margin-bottom: 0;
    }
}

/* --- Spot Cards Tighter Layout --- */
@media (max-width: 480px) {
    .spot-grid {
        gap: 8px;
    }

    .spot-card {
        padding: 12px;
    }

    .spot-symbol {
        font-size: 11px;
        padding: 3px 8px;
    }

    .spot-label {
        font-size: 10px;
    }

    .spot-price {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .spot-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .spot-chart-hint {
        font-size: 10px;
    }
}

/* --- Chart Height Responsive --- */
@media (max-width: 480px) {
    .chart-container {
        height: 220px;
    }

    .timeline-chart-container {
        height: 260px;
    }

    .sector-chart-container {
        height: 260px;
    }

    .holding-chart-container {
        height: 120px;
    }

    #chart-container {
        height: 240px !important;
    }
}

/* --- Login Card Full Width on Small Phones --- */
@media (max-width: 400px) {
    .login-container {
        padding: 0;
        align-items: stretch;
    }

    .login-card {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 24px;
    }

    .login-title {
        font-size: 22px;
    }
}

/* ==========================================================
   PHASE 3: POLISH FIXES
   ========================================================== */

/* --- Form Help Items Stacking --- */
@media (max-width: 480px) {
    .form-help {
        flex-direction: column;
        gap: 8px;
    }

    .form-help-item {
        font-size: 12px;
    }
}

/* --- Button Group Better Spacing --- */
@media (max-width: 480px) {
    .btn-group {
        gap: 8px;
    }

    .btn-group .btn {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* --- Benchmark Toggles Mobile --- */
@media (max-width: 480px) {
    .timeline-legend-row {
        padding-top: 8px;
        margin-top: 8px;
    }

    .timeline-legend {
        flex-wrap: wrap;
        gap: 8px 16px;
        justify-content: flex-start;
    }

    .benchmark-toggles {
        gap: 12px;
        flex-wrap: wrap;
    }

    .benchmark-toggle {
        font-size: 11px;
    }

    .legend-item {
        font-size: 10px;
    }
}

/* --- Position History Modal Mobile --- */
@media (max-width: 480px) {
    #position-history-modal {
        padding: 10px;
    }

    .position-history-modal-content {
        padding: 16px;
        max-height: 90vh;
    }

    .position-history-header h3 {
        font-size: 16px;
    }

    .position-history-range {
        font-size: 11px;
    }

    .position-history-chart-container {
        height: 160px;
    }
}

/* --- Collapsible Sections Touch Targets --- */
@media (max-width: 768px) {
    .collapsible-header {
        padding: 16px 0;
        min-height: 52px;
    }

    .collapsible-title {
        font-size: 15px;
    }

    .collapsible-summary {
        font-size: 13px;
    }

    .collapsible-header::before {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }
}

/* --- Card Padding Mobile --- */
@media (max-width: 400px) {
    .card {
        padding: 12px;
        border-radius: 10px;
    }

    .card-header-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-title {
        font-size: 14px;
    }
}

/* --- Report Panel Mobile Adjustments --- */
@media (max-width: 400px) {
    .report-panel {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
    }

    .report-panel-body {
        max-height: 300px;
    }
}

/* --- Search Bar Mobile --- */
@media (max-width: 480px) {
    .report-search-bar {
        padding: 10px 14px;
    }

    .report-search-input {
        font-size: 14px;
    }

    .report-search-count {
        font-size: 11px;
    }

    .report-search-count::before {
        display: none;
    }
}

/* --- Help Row Mobile --- */
@media (max-width: 480px) {
    .help-row {
        flex-direction: column;
        gap: 8px;
    }

    .help-text {
        font-size: 12px;
    }
}

/* --- Dividend Income Header Mobile --- */
@media (max-width: 480px) {
    .dividend-income-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .dividend-income-label {
        font-size: 12px;
        flex: 1;
        min-width: 150px;
    }

    .dividend-income-value {
        font-size: 14px;
    }
}

/* --- PM Holdings Layout Mobile --- */
@media (max-width: 600px) {
    .pm-holdings-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* --- Allocation Bars Mobile --- */
@media (max-width: 480px) {
    .alloc-item {
        margin-bottom: 16px;
    }

    .alloc-name {
        font-size: 13px;
    }

    .alloc-pct {
        font-size: 13px;
    }
}

/* --- Detail Row Mobile --- */
@media (max-width: 480px) {
    .detail-row td {
        padding: 10px;
    }

    .detail-content {
        gap: 6px;
    }

    .detail-item {
        font-size: 11px;
    }

    .option-detail-grid {
        gap: 10px;
    }

    .option-detail-section {
        padding: 10px 12px;
    }

    .option-detail-section h4 {
        font-size: 10px;
        margin-bottom: 8px;
    }

    .option-metric {
        font-size: 11px;
    }
}

/* --- Weekly Report Card Header Mobile --- */
@media (max-width: 480px) {
    #generate-report-btn {
        width: 100%;
        margin-top: 8px;
    }

    #generate-report-btn svg {
        display: none;
    }
}

/* --- Navigation Improvements for Small Screens --- */
@media (max-width: 400px) {
    .navbar {
        padding: 0 10px;
    }

    .navbar-brand-text {
        font-size: 13px;
    }

    .navbar-brand-icon {
        width: 28px;
        height: 28px;
        border-radius: 10px;
    }

    .navbar-brand-icon svg {
        width: 14px;
        height: 14px;
    }

    .menu-toggle {
        padding: 6px;
    }

    .nav-link {
        padding: 14px 16px;
        font-size: 15px;
        height: 48px;
    }

    .nav-right a {
        padding: 14px 16px;
        height: 48px;
    }
}

/* --- Main Content Area Mobile --- */
@media (max-width: 400px) {
    .main {
        padding: 64px 10px 20px;
    }

    .page-title {
        font-size: 18px;
        line-height: 1.3;
    }

    .page-subtitle {
        font-size: 13px;
    }
}

/* --- Table Row Hover States for Touch --- */
@media (hover: none) and (pointer: coarse) {
    .data-table tbody tr:hover {
        background: transparent;
    }

    .data-table tbody tr:active {
        background: var(--cat-blue);
    }

    .dividend-table tbody tr:hover {
        background: transparent;
    }

    .spot-card:hover {
        border-color: var(--card-border);
    }

    .spot-card:active {
        border-color: var(--primary);
        background: var(--cat-blue);
    }
}

/* --- Improve Tap Targets --- */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 40px;
    }

    .report-btn {
        min-height: 40px;
    }

    .chart-period-btn {
        min-height: 40px;
        min-width: 44px;
    }

    .show-more-btn {
        min-height: 44px;
    }

    .accordion-header {
        min-height: 56px;
    }
}


/* --- Timeline Header Mobile Tweaks --- */
@media (max-width: 480px) {
    /* Reduce collapsible header padding */
    .collapsible-header {
        padding: 12px 0;
        min-height: 44px;
    }

    /* Hide full title, show short title on mobile for timeline */
    #analytics-content .collapsible-title .full-title {
        display: none;
    }

    #analytics-content .collapsible-title .short-title {
        display: inline;
    }
}

@media (min-width: 481px) {
    /* Show full title on larger screens */
    #analytics-content .collapsible-title .full-title {
        display: inline;
    }

    #analytics-content .collapsible-title .short-title {
        display: none;
    }
}
