/* ==============================================
   SCENARIO-ANALYSIS.CSS — Drive Design Language
   Light mode default · No animations
   Matches AlphaVault Drive visual system
   ============================================== */

/* ════════════════════════════════════════════
   1. CSS VARIABLES — LIGHT MODE (DEFAULT)
════════════════════════════════════════════ */
:root {
    --sa-bg:          #f1f5f9;
    --sa-sidebar-bg:  #ffffff;
    --sa-header-bg:   rgba(255, 255, 255, 0.97);
    --sa-card:        #ffffff;
    --sa-card-hover:  #f8fafc;
    --sa-input-bg:    rgba(0, 0, 0, 0.04);
    --sa-border:       rgba(0, 0, 0, 0.08);
    --sa-border-hover: rgba(0, 0, 0, 0.15);
    --sa-text:       #1e293b;
    --sa-text-muted: #475569;
    --sa-text-dim:   #94a3b8;
    --sa-primary:      #667eea;
    --sa-primary-dark: #764ba2;
    --sa-green:        #10b981;
    --sa-amber:        #f59e0b;
    --sa-red:          #ef4444;
    --sa-purple:       #8b5cf6;
    --sa-radius:    10px;
    --sa-radius-lg: 16px;
    --sa-radius-xl: 24px;
    --sa-shadow:    0 1px 4px rgba(0, 0, 0, 0.06);
    --sa-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --sa-sidebar-w: 260px;
    --sa-header-h:  58px;
}

/* ════════════════════════════════════════════
   2. DARK MODE OVERRIDE
════════════════════════════════════════════ */
body.dark-mode {
    --sa-bg:           #0b1120;
    --sa-sidebar-bg:   #0f172a;
    --sa-header-bg:    rgba(11, 17, 32, 0.97);
    --sa-card:         rgba(30, 41, 59, 0.92);
    --sa-card-hover:   rgba(51, 65, 85, 0.9);
    --sa-input-bg:     rgba(255, 255, 255, 0.06);
    --sa-border:       rgba(255, 255, 255, 0.08);
    --sa-border-hover: rgba(255, 255, 255, 0.15);
    --sa-text:         #f0f4f8;
    --sa-text-muted:   #cbd5e1;
    --sa-text-dim:     #94a3b8;
}

/* ════════════════════════════════════════════
   3. RESET & BASE
════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body.sa-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--sa-bg);
    color: var(--sa-text);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ════════════════════════════════════════════
   4. APP LAYOUT
════════════════════════════════════════════ */
#saApp {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ────────────────────────────────────────────
   SIDEBAR
──────────────────────────────────────────── */
#saSidebar {
    width: var(--sa-sidebar-w);
    flex-shrink: 0;
    background: var(--sa-sidebar-bg);
    border-right: 1px solid var(--sa-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: visible;
    position: relative;
    z-index: 200;
    transition: width 0.25s ease, transform 0.3s ease;
}

body:not(.dark-mode) #saSidebar {
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
}

#saSidebar.collapsed { width: 64px; }

#saSidebar.collapsed .sa-nav-item-text,
#saSidebar.collapsed .sa-nav-badge,
#saSidebar.collapsed .sa-nav-label,
#saSidebar.collapsed .sa-platform-nav,
#saSidebar.collapsed .sa-sidebar-footer > .sa-sidebar-user-trigger > div,
#saSidebar.collapsed #saUserPlan,
#saSidebar.collapsed #saUserChevron {
    display: none;
}

#saSidebar.collapsed .sa-nav-item {
    justify-content: center;
    padding: 10px;
}

#saSidebar.collapsed .sa-nav-item-icon { margin: 0; }

.sa-sidebar-logo-text {
    display: block;
    height: 34px;
    object-fit: contain;
    max-width: 160px;
}

.sa-sidebar-logo-icon {
    display: none;
    height: 32px;
    width: 32px;
    object-fit: contain;
}

#saSidebar.collapsed .sa-sidebar-logo-text { display: none; }

#saSidebar.collapsed .sa-sidebar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 0 10px;
    width: 100%;
}

.sa-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sa-sidebar-scroll::-webkit-scrollbar { width: 3px; }

.sa-sidebar-scroll::-webkit-scrollbar-thumb {
    background: var(--sa-border);
    border-radius: 4px;
}

.sa-sidebar-toggle {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sa-card);
    border: 1px solid var(--sa-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--sa-text-muted);
    font-size: 10px;
    z-index: 300;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.sa-sidebar-toggle:hover {
    background: var(--sa-primary);
    color: #fff;
    border-color: var(--sa-primary);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* ────────────────────────────────────────────
   MAIN AREA
──────────────────────────────────────────── */
#saMain {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
}

/* ════════════════════════════════════════════
   5. HEADER
════════════════════════════════════════════ */
#saHeader {
    height: var(--sa-header-h);
    background: var(--sa-header-bg);
    border-bottom: 1px solid var(--sa-border);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.sa-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sa-breadcrumb-item {
    font-size: 12px;
    font-weight: 700;
    color: var(--sa-text-dim);
    white-space: nowrap;
}

.sa-breadcrumb-item.active { color: var(--sa-text); }
.sa-breadcrumb-sep { font-size: 9px; color: var(--sa-text-dim); }

.sa-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.sa-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--sa-input-bg);
    border: 1px solid var(--sa-border);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sa-text-muted);
}

.sa-header-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--sa-text);
    border-color: var(--sa-border-hover);
}

body.dark-mode .sa-header-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sa-theme-toggle {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sa-input-bg);
    border: 1px solid var(--sa-border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--sa-text-muted);
    font-size: 14px;
}

.sa-theme-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--sa-primary);
    border-color: rgba(102, 126, 234, 0.2);
}

.sa-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--sa-input-bg);
    border: 1px solid var(--sa-border);
    border-radius: 10px;
    color: var(--sa-text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

.sa-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sa-primary), var(--sa-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════
   6. PLATFORM NAV (sidebar)
════════════════════════════════════════════ */
.sa-platform-nav { padding: 0 0 8px; }

.sa-platform-divider {
    border: none;
    border-top: 1px solid var(--sa-border);
    margin: 8px 16px;
}

.sa-platform-section { margin-bottom: 1px; }

.sa-platform-folder {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--sa-text-muted);
    border-radius: 10px;
    margin: 0 8px;
    background: none;
    border: none;
    width: calc(100% - 16px);
    text-align: left;
}

.sa-platform-folder:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--sa-text);
}

body.dark-mode .sa-platform-folder:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sa-text);
}

.sa-platform-folder i:first-child {
    font-size: 13px;
    width: 16px;
    text-align: center;
}

.sa-platform-folder .arrow {
    margin-left: auto;
    font-size: 9px;
    transition: transform 0.2s;
}

.sa-platform-folder.open .arrow { transform: rotate(180deg); }

.sa-platform-submenu { display: none; padding: 2px 0; }
.sa-platform-submenu.open { display: block; }

.sa-platform-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 36px;
    font-size: 11px;
    font-weight: 500;
    color: var(--sa-text-dim);
    text-decoration: none;
    border-radius: 8px;
    margin: 0 8px;
}

.sa-platform-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--sa-text-muted);
}

body.dark-mode .sa-platform-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--sa-text-muted);
}

.sa-platform-link.active {
    color: var(--sa-primary);
    background: rgba(102, 126, 234, 0.08);
}

.sa-platform-link i {
    font-size: 11px;
    width: 14px;
    text-align: center;
}

/* ════════════════════════════════════════════
   7. DRIVE NAV (sidebar)
════════════════════════════════════════════ */
.sa-nav { padding: 4px 8px; }
.sa-nav-section { margin-bottom: 6px; }

.sa-nav-label {
    padding: 10px 10px 5px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--sa-text-dim);
}

.sa-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--sa-text-muted);
    margin-bottom: 2px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.sa-nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--sa-text);
}

body.dark-mode .sa-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sa-text);
}

.sa-nav-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--sa-primary);
}

.sa-nav-item-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sa-nav-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════════════════════════════════
   8. SIDEBAR FOOTER
════════════════════════════════════════════ */
.sa-sidebar-footer {
    border-top: 1px solid var(--sa-border);
    position: relative;
    flex-shrink: 0;
}

.sa-sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
}

.sa-sidebar-user-trigger:hover { background: rgba(0, 0, 0, 0.04); }
body.dark-mode .sa-sidebar-user-trigger:hover { background: rgba(255, 255, 255, 0.04); }

.sa-sidebar-user-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--sa-card);
    border: 1px solid var(--sa-border);
    border-radius: 14px;
    padding: 8px;
    margin: 0 8px 6px;
    z-index: 1000;
}

body:not(.dark-mode) .sa-sidebar-user-dropdown {
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
}

body.dark-mode .sa-sidebar-user-dropdown {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.sa-sidebar-user-dropdown.open { display: block; }

.sa-sidebar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--sa-border);
    margin-bottom: 6px;
}

.sa-sidebar-dropdown-header img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.sa-sidebar-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--sa-text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
}

.sa-sidebar-dropdown-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--sa-text);
}

body.dark-mode .sa-sidebar-dropdown-link:hover { background: rgba(255, 255, 255, 0.05); }

.sa-sidebar-dropdown-link i { font-size: 13px; width: 16px; text-align: center; }

.sa-sidebar-dropdown-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--sa-red);
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    background: none;
    border: none;
    border-top: 1px solid var(--sa-border);
    width: 100%;
    text-align: left;
    margin-top: 4px;
}

.sa-sidebar-dropdown-logout:hover { background: rgba(239, 68, 68, 0.08); }

.sa-mobile-close-btn {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--sa-input-bg);
    border: 1px solid var(--sa-border);
    color: var(--sa-text-muted);
    font-size: 14px;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.sa-mobile-close-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--sa-red);
}

@media (max-width: 768px) {
    .sa-mobile-close-btn { display: flex; }
}

/* ════════════════════════════════════════════
   9. CONTENT AREA
════════════════════════════════════════════ */
#saContent {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 32px;
    background: var(--sa-bg);
}

#saContent::-webkit-scrollbar { width: 5px; }

#saContent::-webkit-scrollbar-thumb {
    background: var(--sa-border);
    border-radius: 4px;
}

/* ════════════════════════════════════════════
   10. SECTION WRAPPER
════════════════════════════════════════════ */
.section {
    background: var(--sa-card);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--sa-shadow);
}

body.dark-mode .section { box-shadow: none; }

/* ════════════════════════════════════════════
   11. SECTION TITLE
════════════════════════════════════════════ */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: var(--sa-text);
    margin-bottom: 18px;
}

.section-title i { color: var(--sa-primary); font-size: 15px; }

.help-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    color: var(--sa-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid rgba(102, 126, 234, 0.2);
    flex-shrink: 0;
}

.help-icon:hover {
    background: var(--sa-primary);
    color: #fff;
}

/* ════════════════════════════════════════════
   12. INFO BOX / RESPONSIVE TEXT BOX
════════════════════════════════════════════ */
.info-box,
.responsive-text-box {
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.18);
    border-left: 4px solid var(--sa-primary);
    border-radius: var(--sa-radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

body.dark-mode .info-box,
body.dark-mode .responsive-text-box {
    background: rgba(102, 126, 234, 0.07);
}

.responsive-text-wrapper { width: 100%; overflow-x: hidden; }

.info-box-content { width: 100%; }

.info-box h4,
.info-box-content h4 {
    font-size: 13px;
    font-weight: 800;
    color: var(--sa-primary);
    margin-bottom: 12px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.info-box p,
.info-box-content p {
    color: var(--sa-text-muted);
    font-size: 13px;
    line-height: 1.75;
    margin-bottom: 8px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.info-box p:last-child,
.info-box-content p:last-child { margin-bottom: 0; }

.info-box strong,
.info-box-content strong {
    color: var(--sa-primary);
    font-weight: 700;
}

/* ════════════════════════════════════════════
   13. WARNING BOX
════════════════════════════════════════════ */
.warning-box {
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-left: 4px solid var(--sa-amber);
    border-radius: var(--sa-radius-lg);
    padding: 16px 20px;
    margin: 16px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.warning-box i {
    font-size: 16px;
    color: var(--sa-amber);
    flex-shrink: 0;
    margin-top: 1px;
}

.warning-box p {
    margin: 0;
    color: var(--sa-text-muted);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ════════════════════════════════════════════
   14. SUCCESS BOX
════════════════════════════════════════════ */
.success-box {
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-left: 4px solid var(--sa-green);
    border-radius: var(--sa-radius-lg);
    padding: 16px 20px;
    margin: 16px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.success-box i {
    font-size: 16px;
    color: var(--sa-green);
    flex-shrink: 0;
    margin-top: 1px;
}

.success-box p {
    margin: 0;
    color: var(--sa-text-muted);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Modal body utility classes */
.key-term {
    background: rgba(102, 126, 234, 0.1);
    color: var(--sa-primary);
    padding: 1px 7px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
}

.tip-box {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--sa-text-muted);
    margin-top: 12px;
    line-height: 1.65;
}

/* ════════════════════════════════════════════
   15. PORTFOLIO INPUT (Drive card style)
════════════════════════════════════════════ */
.portfolio-input {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--sa-radius-xl);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
}

body.dark-mode .portfolio-input {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(15, 23, 42, 0.6));
}

.input-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--sa-text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-title i { color: var(--sa-primary); }

/* ════════════════════════════════════════════
   16. PORTFOLIO GRID & ITEMS
════════════════════════════════════════════ */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.portfolio-item {
    background: var(--sa-card);
    border: 1px solid var(--sa-border);
    border-left: 4px solid var(--sa-primary);
    border-radius: var(--sa-radius-lg);
    padding: 16px;
    box-shadow: var(--sa-shadow);
    position: relative;
}

body.dark-mode .portfolio-item { box-shadow: none; }

.portfolio-item:hover {
    border-color: rgba(102, 126, 234, 0.35);
    border-left-color: var(--sa-primary);
    box-shadow: var(--sa-shadow-md);
}

.portfolio-item label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: var(--sa-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.portfolio-item input {
    width: 100%;
    background: var(--sa-input-bg);
    border: 1px solid var(--sa-border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--sa-text);
    outline: none;
    font-family: inherit;
}

.portfolio-item input:focus {
    border-color: var(--sa-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.portfolio-item input::placeholder { color: var(--sa-text-dim); }

/* ════════════════════════════════════════════
   17. TOTAL ALLOCATION DISPLAY
════════════════════════════════════════════ */
.total-allocation-display {
    background: var(--sa-card);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius-lg);
    padding: 16px 20px;
    text-align: center;
    box-shadow: var(--sa-shadow);
}

body.dark-mode .total-allocation-display { box-shadow: none; }

.total-allocation-display strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--sa-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.total-allocation-display span {
    font-size: 22px;
    font-weight: 900;
    color: var(--sa-primary);
    margin-left: 12px;
}

.total-allocation-display span.error {
    color: var(--sa-red);
}

/* ════════════════════════════════════════════
   18. ANALYZE BUTTON
════════════════════════════════════════════ */
.btn-analyze {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: linear-gradient(135deg, var(--sa-primary), var(--sa-primary-dark));
    color: #fff;
    padding: 14px 32px;
    border: none;
    border-radius: var(--sa-radius-lg);
    font-size: 14px;
    font-weight: 700;
    margin-top: 20px;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

.btn-analyze:hover {
    box-shadow: 0 6px 22px rgba(102, 126, 234, 0.45);
    opacity: 0.95;
}

.btn-analyze i { font-size: 16px; }

/* ════════════════════════════════════════════
   19. SCENARIO CARDS
════════════════════════════════════════════ */
.scenario-card {
    background: var(--sa-card);
    border: 1px solid var(--sa-border);
    border-left: 4px solid var(--sa-primary);
    border-radius: var(--sa-radius-lg);
    padding: 20px 24px;
    margin-bottom: 14px;
    box-shadow: var(--sa-shadow);
    position: relative;
}

body.dark-mode .scenario-card { box-shadow: none; }

.scenario-card:hover {
    border-color: rgba(102, 126, 234, 0.35);
    border-left-color: var(--sa-primary);
    box-shadow: var(--sa-shadow-md);
}

.scenario-card:last-child { margin-bottom: 0; }

.scenario-card h3 {
    font-size: 14px;
    font-weight: 800;
    color: var(--sa-text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scenario-card p {
    color: var(--sa-text-muted);
    font-size: 12px;
    line-height: 1.65;
    margin-bottom: 14px;
}

/* ════════════════════════════════════════════
   20. IMPACT BADGES
════════════════════════════════════════════ */
.scenario-impacts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.impact-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.impact-positive {
    background: rgba(16, 185, 129, 0.12);
    color: var(--sa-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.impact-negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--sa-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ════════════════════════════════════════════
   21. RESULTS GRID & RESULT CARDS
════════════════════════════════════════════ */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.result-card {
    background: var(--sa-card);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--sa-shadow);
}

body.dark-mode .result-card { box-shadow: none; }

.result-card:hover {
    border-color: var(--sa-border-hover);
    box-shadow: var(--sa-shadow-md);
}

.result-card h4 {
    font-size: 10px;
    font-weight: 800;
    color: var(--sa-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.result-card .value {
    font-size: 26px;
    font-weight: 900;
    color: var(--sa-primary);
    line-height: 1.2;
}

.result-card.positive .value { color: var(--sa-green); }
.result-card.negative .value { color: var(--sa-red); }

.result-card .value-icon {
    font-size: 16px;
    margin-left: 8px;
    opacity: 0.7;
}

/* ════════════════════════════════════════════
   22. SUBSECTION TITLE
════════════════════════════════════════════ */
.subsection-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--sa-text);
    margin-bottom: 16px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subsection-title:first-of-type { margin-top: 0; }
.subsection-title i { color: var(--sa-primary); }

/* ════════════════════════════════════════════
   23. CHART CONTAINER
════════════════════════════════════════════ */
.chart-container {
    background: var(--sa-input-bg);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.chart-container h4 {
    font-size: 13px;
    font-weight: 800;
    color: var(--sa-text);
    margin-bottom: 16px;
}

/* ════════════════════════════════════════════
   24. DETAILED TABLE
════════════════════════════════════════════ */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--sa-radius-lg);
    box-shadow: var(--sa-shadow);
    margin-top: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--sa-primary) var(--sa-input-bg);
}

.table-responsive-wrapper::-webkit-scrollbar { height: 6px; }

.table-responsive-wrapper::-webkit-scrollbar-track {
    background: var(--sa-input-bg);
    border-radius: 4px;
}

.table-responsive-wrapper::-webkit-scrollbar-thumb {
    background: var(--sa-primary);
    border-radius: 4px;
}

.detailed-table-container {
    background: var(--sa-card);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius-lg);
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.detailed-table {
    width: 100%;
    min-width: 700px;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--sa-card);
}

.detailed-table thead {
    background: linear-gradient(135deg, var(--sa-primary), var(--sa-primary-dark));
}

.detailed-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #fff;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.detailed-table th:last-child { border-right: none; }

.detailed-table tbody tr {
    border-bottom: 1px solid var(--sa-border);
}

.detailed-table tbody tr:nth-child(even) {
    background: rgba(102, 126, 234, 0.03);
}

body.dark-mode .detailed-table tbody tr:nth-child(even) {
    background: rgba(102, 126, 234, 0.06);
}

.detailed-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.07);
}

.detailed-table tbody tr:last-child { border-bottom: none; }

.detailed-table td {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sa-text);
    border-right: 1px solid var(--sa-border);
    white-space: nowrap;
    background: transparent;
}

.detailed-table td:last-child { border-right: none; }

.detailed-table .scenario-name {
    font-weight: 800;
    color: var(--sa-primary);
    font-size: 12px;
}

.detailed-table .return-positive {
    background: rgba(16, 185, 129, 0.12);
    color: var(--sa-green);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.detailed-table .return-negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--sa-red);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 700;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.detailed-table .return-neutral {
    background: var(--sa-input-bg);
    color: var(--sa-text-muted);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 700;
    border: 1px solid var(--sa-border);
}

/* ════════════════════════════════════════════
   25. LOADING OVERLAY
════════════════════════════════════════════ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--sa-primary);
    border-radius: 50%;
}

.loading-text {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-top: 16px;
    text-align: center;
}

/* ════════════════════════════════════════════
   26. FOOTER
════════════════════════════════════════════ */
footer {
    padding: 20px 0 4px;
    text-align: center;
    font-size: 11px;
    color: var(--sa-text-dim);
    border-top: 1px solid var(--sa-border);
    margin-top: 20px;
}

/* ════════════════════════════════════════════
   27. UTILITY
════════════════════════════════════════════ */
.hidden { display: none !important; }

.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 10px !important; }
.mt-2 { margin-top: 20px !important; }
.mt-3 { margin-top: 30px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 10px !important; }
.mb-2 { margin-bottom: 20px !important; }
.mb-3 { margin-bottom: 30px !important; }

/* ════════════════════════════════════════════
   28. SCROLLBARS
════════════════════════════════════════════ */
* { scrollbar-width: thin; scrollbar-color: var(--sa-border) transparent; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background: var(--sa-border); border-radius: 4px; }

/* ════════════════════════════════════════════
   29. RESPONSIVE — TABLET (≤ 1200px)
════════════════════════════════════════════ */
@media (max-width: 1200px) {
    :root { --sa-sidebar-w: 240px; }
    .results-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ════════════════════════════════════════════
   30. RESPONSIVE — MOBILE (≤ 768px)
════════════════════════════════════════════ */
@media (max-width: 768px) {
    html, body { overflow: hidden; }

    #saSidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        overflow-y: auto;
        overflow-x: hidden;
    }

    #saSidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 40px rgba(0, 0, 0, 0.2);
    }

    .sa-sidebar-toggle { display: none !important; }
    .sa-mobile-toggle { display: flex !important; }

    #saContent { padding: 16px; }

    .portfolio-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .results-grid   { grid-template-columns: 1fr 1fr; gap: 10px; }

    .section { padding: 16px; }
    .portfolio-input { padding: 16px; }
    .scenario-card { padding: 16px 18px; }

    .detailed-table { min-width: 650px; }
    .detailed-table th, .detailed-table td { padding: 10px 12px; font-size: 11px; }

    .impact-badge { padding: 4px 10px; font-size: 10px; }

    .result-card .value { font-size: 20px; }
}

/* ════════════════════════════════════════════
   31. RESPONSIVE — SMALL (≤ 480px)
════════════════════════════════════════════ */
@media (max-width: 480px) {
    :root { --sa-header-h: 52px; }
    #saHeader { padding: 0 12px; }
    #saContent { padding: 12px; }

    .portfolio-grid { grid-template-columns: 1fr; }
    .results-grid   { grid-template-columns: 1fr; }

    .input-title { flex-direction: column; text-align: center; font-size: 13px; }
    .portfolio-item { padding: 12px; }
    .scenario-card { padding: 12px 14px; }
    .scenario-card h3 { font-size: 13px; }
    .impact-badge { padding: 3px 8px; font-size: 10px; }

    .detailed-table { min-width: 580px; }
    .detailed-table th, .detailed-table td { padding: 9px 10px; font-size: 10px; }

    .result-card { padding: 16px; }
    .result-card .value { font-size: 18px; }
    .sa-header-btn span { display: none; }
}