/* Reset and Base Styles */
/* YODLEE DESIGN SYSTEM v1.0 - Aligned with Yodlee Brand Standards */
/* Font: System fonts for clean, professional appearance */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Iframe-compatible responsive sizing */
html {
    height: 100%;
}

:root {
    /* Yodlee Brand Colors */
    --yodlee-primary: #5B5D8C;
    --yodlee-primary-dark: #4A4D7C;
    --yodlee-primary-light: #6B6E9C;
    --yodlee-accent: #7C7FA8;
    
    /* Neutral Colors */
    --yodlee-bg-main: #F5F5F7;
    --yodlee-bg-card: #FFFFFF;
    --yodlee-border: #E1E1E6;
    --yodlee-border-light: #EFEFEF;
    
    /* Text Colors */
    --yodlee-text-primary: #2C2C2E;
    --yodlee-text-secondary: #6C6C70;
    --yodlee-text-tertiary: #8E8E93;
    
    /* Shadows */
    --yodlee-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --yodlee-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --yodlee-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.10);
    
    /* Border Radius */
    --yodlee-radius-sm: 6px;
    --yodlee-radius-md: 10px;
    --yodlee-radius-lg: 14px;
}

body {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--yodlee-bg-main);
    color: var(--yodlee-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    /* Iframe-compatible responsive sizing - fallback chain */
    height: 100%;
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height - better for iframes/mobile */
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure all elements use Aptos Narrow */
*, *::before, *::after {
    font-family: inherit;
}

h1, h2, h3, h4, h5, h6, p, span, div, button, input, select, textarea, label {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Container Layout */
.container {
    display: flex;
    /* Iframe-compatible responsive sizing - fallback chain */
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height - better for iframes/mobile */
    position: relative;
    z-index: 1;
}

/* Compact Dollar Amount Slider Styles */
.compact-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.compact-slider {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.compact-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: rgba(174, 234, 215, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(36, 33, 89, 0.2);
}

.compact-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(36, 33, 89, 0.2);
}

.compact-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: rgba(174, 234, 215, 0.3);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(36, 33, 89, 0.2);
}

.compact-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(36, 33, 89, 0.2);
}

.compact-slider::-moz-range-track {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    border: none;
}

.compact-slider:focus {
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.2);
}

.slider-value {
    min-width: 65px;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: var(--yodlee-radius-md);
    border: 1px solid var(--yodlee-border);
    background: var(--yodlee-bg-card);
    color: var(--yodlee-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--yodlee-shadow-sm);
}

.sidebar-toggle:hover {
    background: var(--yodlee-bg-main);
    transform: translateY(-1px);
    border-color: var(--yodlee-primary);
    box-shadow: var(--yodlee-shadow-md);
}

.sidebar-toggle i,
.sidebar-toggle svg,
.sidebar-toggle .chevron-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.sidebar-toggle.rotated i,
.sidebar-toggle.rotated svg,
.sidebar-toggle.rotated .chevron-icon {
    transform: rotate(180deg);
}

/* Sidebar - AI Assistant */
.sidebar {
    width: 275px;
    background: var(--yodlee-bg-card);
    border-right: 1px solid var(--yodlee-border);
    box-shadow: var(--yodlee-shadow-sm);
    display: flex;
    flex-direction: column;
    position: fixed;
    /* Iframe-compatible responsive sizing - fallback chain */
    height: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height - better for iframes/mobile */
    left: 0;
    top: 0;
    z-index: 1000;
    /* Use consistent cubic-bezier for smoother animation */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease,
                border-right 0.3s ease;
    overflow: hidden;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.sidebar * {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar.chat-expanded {
    width: min(45vw, 600px);
    max-width: 600px;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
    border-right: 2px solid rgba(46, 90, 80, 0.4);
    /* Ensure transition is inherited and consistent */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease,
                border-right 0.3s ease;
}

.sidebar.chat-expanded .chat-messages {
    padding: 15px;
}

.sidebar.chat-expanded .chat-input-container {
    padding: 15px;
}

.sidebar.chat-expanded .chat-input {
    min-height: 80px;
}

.sidebar.chat-expanded .sidebar-header {
    background: rgba(74, 144, 226, 0.05);
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
}

/* Expanded chat view - wider tables with improved layout */
.sidebar.chat-expanded .message-text {
    max-width: 650px; /* Increased from 550px for better table display */
    word-break: normal; /* Changed to normal for better table rendering */
    overflow-wrap: normal;
    hyphens: none; /* Disabled for tables */
    white-space: normal; /* Changed from pre-wrap */
    overflow-x: auto; /* Allow horizontal scroll for wide tables */
    box-sizing: border-box;
}

.sidebar.chat-expanded .message-text table {
    font-size: 0.7rem; /* Further reduced for compact UI */
    width: auto; /* Allow natural width in expanded view */
    min-width: 100%;
}

.sidebar.chat-expanded .message-text th,
.sidebar.chat-expanded .message-text td {
    padding: 14px 18px; /* Increased from 8px 10px for better spacing */
    white-space: nowrap; /* Prevent text wrapping in expanded view */
}

/* Ensure sidebar is visible on desktop */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }
}

.sidebar-header {
    padding: 16px 20px;
    background: var(--yodlee-bg-card);
    border-bottom: 1px solid var(--yodlee-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.sidebar-header i {
    color: var(--yodlee-primary);
    font-size: 0.75rem;
}

.sidebar-header h3 {
    color: var(--yodlee-primary);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 140px);
    word-wrap: break-word;
}

.chat-message {
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
    overflow: hidden;
    font-family: 'Outfit', 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.bot-message p {
    font-size: 0.95rem; /* Increased from 0.75rem for better readability */
    margin: 0;
    padding: 0;
    line-height: 1.5; /* Slightly increased line height for better spacing */
    font-family: 'Outfit', 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.message-icon {
    color: rgba(46, 90, 80, 0.8);
    margin-top: 3px;
    font-size: 0.9rem;
}

/* Message Text Container (replacing old p styles) */
.message-text {
    background: #f8fafc;
    padding: 8px 10px; /* Slightly increased padding for better readability */
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem; /* Increased from 0.6rem for much better readability */
    line-height: 1.5; /* Increased from 1.2 for better spacing */
    max-width: 100%; /* Allow full width */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: pre-wrap;
    overflow: hidden;
    box-sizing: border-box;
    color: #1a1a1a;
    font-family: 'Outfit', 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* General overflow prevention for all elements within message-text */
.message-text * {
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* Special handling for links and URLs */
.message-text a {
    word-break: break-all;
    overflow-wrap: break-word;
    hyphens: none;
}

.message-text p {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    font-size: inherit;
    line-height: inherit;
    max-width: none;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: pre-wrap;
}

/* Markdown Table Styles - Improved Readability */
.message-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.8rem; /* Properly readable size */
    background: rgba(255, 255, 255, 0.98);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    table-layout: auto; /* Changed from fixed to auto for better column sizing */
    word-break: normal; /* Changed from break-word to normal */
    overflow-wrap: normal;
    white-space: nowrap; /* Prevent unnecessary wrapping */
}

.message-text th,
.message-text td {
    padding: 12px 16px; /* Increased padding from 8px 10px */
    text-align: left;
    border-bottom: 1px solid rgba(189, 195, 199, 0.25);
    vertical-align: middle; /* Changed from top to middle */
    word-break: normal; /* Changed from break-word */
    overflow-wrap: normal;
    hyphens: none; /* Disabled hyphenation */
    max-width: none; /* Removed width constraint */
    min-width: fit-content; /* Ensure minimum width for content */
}

.message-text th {
    background: linear-gradient(135deg, rgba(36, 33, 89, 0.12) 0%, rgba(74, 144, 226, 0.12) 100%);
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid rgba(74, 144, 226, 0.4);
    font-size: 0.85rem; /* Increased from 0.75rem for better readability */
    font-family: 'Outfit', 'Aptos Narrow', 'Aptos', sans-serif;
    text-transform: none; /* Removed uppercase for better readability */
    letter-spacing: 0.3px;
    white-space: nowrap; /* Prevent header text wrapping */
}

.message-text tr:last-child td {
    border-bottom: none;
}

.message-text tr:nth-child(even) {
    background: rgba(248, 249, 250, 0.5);
}

.message-text tr:hover {
    background: rgba(74, 144, 226, 0.05);
}

/* Responsive table adjustments - Better mobile handling */
@media (max-width: 768px) {
    .message-text table {
        font-size: 0.55rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .message-text th,
    .message-text td {
        padding: 10px 12px; /* Still generous padding on mobile */
        min-width: 100px; /* Minimum column width */
    }
}

/* Table container with horizontal scroll for wide tables */
.message-text {
    overflow-x: auto;
    max-width: none; /* Remove width constraints for tables */
}

/* Table wrapper for better scrolling */
.message-text .table-wrapper {
    overflow-x: auto;
    margin: 12px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-text .table-wrapper table {
    margin: 0; /* Remove margin when inside wrapper */
    box-shadow: none; /* Remove shadow when inside wrapper */
}

.message-text table {
    min-width: 100%; /* Ensure table takes full width */
}

/* Improve table readability with better spacing and borders */
.message-text table tbody tr:first-child td {
    padding-top: 14px; /* Extra space after header */
}

.message-text table tbody tr:last-child td {
    padding-bottom: 14px; /* Extra space before end */
}

/* Better visual separation for table rows */
.message-text tr:nth-child(odd) {
    background: rgba(248, 249, 250, 0.6);
}

.message-text tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.8);
}

/* Ensure number columns are right-aligned for better readability */
.message-text td:has-text("$"), 
.message-text td:has-text(","), 
.message-text td[style*="text-align: right"] {
    text-align: right;
    font-variant-numeric: tabular-nums; /* Use tabular numbers for alignment */
}

/* Additional markdown elements */
.message-text h1, 
.message-text h2, 
.message-text h3, 
.message-text h4, 
.message-text h5, 
.message-text h6 {
    margin: 8px 0 4px 0;
    color: #2c3e50;
    font-weight: 600;
}

.message-text h1 { font-size: 1.15rem; font-family: 'Outfit', 'Aptos Narrow', 'Aptos', sans-serif; } /* Increased from 0.9rem */
.message-text h2 { font-size: 1.05rem; font-family: 'Outfit', 'Aptos Narrow', 'Aptos', sans-serif; } /* Increased from 0.85rem */
.message-text h3 { font-size: 0.98rem; font-family: 'Outfit', 'Aptos Narrow', 'Aptos', sans-serif; } /* Increased from 0.8rem */
.message-text h4 { font-size: 0.92rem; font-family: 'Outfit', 'Aptos Narrow', 'Aptos', sans-serif; } /* Increased from 0.75rem */

.message-text strong {
    font-weight: 600;
    color: #34495e;
}

.message-text em {
    font-style: italic;
    color: #555;
}

.message-text code {
    background: rgba(236, 240, 241, 0.8);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.55rem;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.message-text ul, 
.message-text ol {
    margin: 8px 0;
    padding-left: 20px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.message-text li {
    margin: 2px 0;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.user-message .message-content {
    flex-direction: row-reverse;
}

.user-message .message-text {
    background: rgba(174, 234, 215, 0.3);
    border: 1px solid rgba(36, 33, 89, 0.3);
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: pre-wrap;
    overflow: hidden;
    box-sizing: border-box;
    color: #1a1a1a;
}

.user-message .message-icon {
    color: #34495e;
}

.chat-input-container {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

#chat-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem; /* Increased from 0.7rem for better readability and consistency */
    font-family: 'Outfit', 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 35px;
    max-height: 70px;
    line-height: 1.4;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}

#chat-input:focus {
    border-color: #242159;
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.2);
    outline: none;
}

#send-btn {
    padding: 7px 11px;
    background: var(--yodlee-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--yodlee-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--yodlee-shadow-sm);
}

#send-btn svg {
    width: 14px;
    height: 14px;
}

#send-btn:hover {
    background: var(--yodlee-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
}

#send-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner animation for send button */
.spinner-icon {
    animation: spin 1s linear infinite;
}

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

/* Enhanced Chat Message Types */
.warning-message .message-text {
    background: rgba(241, 196, 15, 0.1) !important;
    border: 2px solid rgba(241, 196, 15, 0.3) !important;
    color: #8c7311 !important;
}

.error-message .message-text {
    background: rgba(231, 76, 60, 0.1) !important;
    border: 2px solid rgba(231, 76, 60, 0.3) !important;
    color: #a04232 !important;
}

/* Typing Indicator Animation */
.typing-indicator {
    opacity: 0.8;
}

.typing-animation {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid rgba(189, 195, 199, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    max-width: 80px;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(36, 33, 89, 0.6);
    animation: typing-bounce 1.4s infinite ease-in-out;
    opacity: 0.3;
}

.typing-animation span:nth-child(1) {
    animation-delay: 0s;
}

.typing-animation span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-animation span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Loading spinner for send button */
#send-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 275px;
    padding: 8px;
    background: transparent;
    /* Iframe-compatible responsive sizing - fallback chain */
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height - better for iframes/mobile */
    /* Use same cubic-bezier as sidebar for synchronized animation */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
    margin-left: 0;
}

.main-content.chat-expanded {
    margin-left: min(45vw, 600px) !important;
    max-width: calc(100vw - min(45vw, 600px));
    min-width: 350px; /* Reduced from 400px to allow more flexibility */
    overflow-x: auto;
    box-sizing: border-box;
    /* Ensure transition consistency with sidebar */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Force responsive layout when chat is expanded */
.main-content.chat-expanded .top-stats-row {
    flex-wrap: wrap !important;
    gap: 12px;
}

.main-content.chat-expanded .stats-boxes-row {
    flex-wrap: wrap !important;
    flex: 1 1 auto;
}

.main-content.chat-expanded .stats-cards-row {
    flex-wrap: wrap !important;
}

.main-content.chat-expanded .impact-card,
.main-content.chat-expanded .stat-card {
    min-width: 150px;
    flex: 1 1 calc(33% - 12px); /* Allow 3 cards per row, or wrap */
}

/* Compact filters when chat is expanded */
.main-content.chat-expanded .date-filter-container {
    min-width: 160px;
    width: auto;
    max-width: 200px;
}

.main-content.chat-expanded .price-range-container {
    min-width: 100px;
    width: auto;
    max-width: 140px;
}

.main-content.chat-expanded .transferable-filter-container,
.main-content.chat-expanded .client-id-filter-container {
    min-width: 90px;
    width: auto;
    max-width: 120px;
}

/* Header */
.header {
    margin-bottom: 8px;
    padding: 20px 24px;
    background: var(--yodlee-bg-card);
    border-radius: var(--yodlee-radius-lg);
    box-shadow: var(--yodlee-shadow-sm);
    border: 1px solid var(--yodlee-border-light);
    position: relative;
    overflow: hidden;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.header * {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}





.header-main-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index: 2;
}

/* Header Yodlee Logo */
.header-yodlee-logo {
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.yodlee-svg-logo {
    height: 32px; /* Increased for better visibility */
    width: auto;
    transition: all 0.2s ease;
}

.header-yodlee-logo:hover .yodlee-svg-logo {
    transform: scale(1.02);
}


/* Header right section - pinned button + logo */
.header-main-section > div:last-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-text {
    flex: 1;
    text-align: left;
}

.header h1 {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--yodlee-primary);
    margin-bottom: 6px;
    margin-top: 0px;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.9rem;
    color: var(--yodlee-text-secondary);
    font-weight: 400;
    margin-top: 4px;
    line-height: 1.4;
}

/* Header AUM Card - Redesigned for title section */
.header-aum-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 15px 20px;
    color: #2c3e50;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.15);
    min-width: 280px;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.header-aum-icon {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.header-aum-icon i {
    font-size: 1.3rem;
    color: white;
}

.header-aum-info {
    flex: 1;
}

.header-aum-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-aum-amount {
    font-size: 1.6rem;
    font-weight: 700;
    color: #3498db;
    letter-spacing: -0.5px;
}

/* Pinned Insights Button */
.pinned-insights-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--yodlee-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--yodlee-shadow-sm);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.pinned-insights-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--yodlee-shadow-md);
    background: var(--yodlee-primary-dark);
}

/* Logout Button Styles */
.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: var(--yodlee-radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--yodlee-shadow-sm);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    font-weight: 500;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
    background: #c82333;
}

.logout-btn i {
    font-size: 0.8rem;
}

.logout-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Modern Logout Button - Icon only, sleek design */
.logout-btn-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.logout-btn-modern i {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.logout-btn-modern:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.logout-btn-modern:hover i {
    transform: translateX(1px);
}

.logout-btn-modern:active {
    transform: translateY(0);
    box-shadow: none;
}

.pinned-insights-btn:hover::after {
    content: 'Pinned Insights';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pinned-insights-btn:hover::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(0, 0, 0, 0.8);
    z-index: 1001;
}

.pinned-count {
    background: #ffffff;
    color: #8B79B1;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Flash animation for when insights are pinned */
@keyframes flash-pin {
    0% { 
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 6px 20px rgba(139, 121, 177, 0.4);
    }
    25% { 
        transform: translateY(-4px) scale(1.15);
        box-shadow: 0 8px 25px rgba(139, 121, 177, 0.6);
        background: #7A6BA0;
    }
    50% { 
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 6px 20px rgba(139, 121, 177, 0.4);
    }
    75% { 
        transform: translateY(-4px) scale(1.15);
        box-shadow: 0 8px 25px rgba(139, 121, 177, 0.6);
        background: #7A6BA0;
    }
    100% { 
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 6px 20px rgba(139, 121, 177, 0.4);
    }
}

.pinned-insights-btn.flash {
    animation: flash-pin 0.6s ease-in-out;
}

.pinned-count.flash {
    animation: flash-pin 0.6s ease-in-out;
}

/* Combined AUM and Filters Section */
.aum-filters-section {
    margin-bottom: 8px;
    margin-top: 0px;
}

.aum-filters-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--yodlee-bg-card);
    padding: 20px;
    border-radius: var(--yodlee-radius-lg);
    border: 1px solid var(--yodlee-border-light);
    box-shadow: var(--yodlee-shadow-sm);
    position: relative;
    overflow: hidden;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    transition: gap 0.3s ease, padding 0.3s ease;
}

.aum-filters-container * {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.top-stats-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 8px;
    width: 100%;
    flex-wrap: wrap; /* Allow items to wrap to next row when space is tight */
    transition: gap 0.3s ease;
}

.stats-boxes-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    justify-content: flex-start;
    flex: 1;
    flex-wrap: wrap; /* Allow stat cards to wrap */
    min-width: 0; /* Allow flex item to shrink */
    transition: gap 0.3s ease;
}

.filters-right-section {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Filter Wrapper and Label */
.date-filter-wrapper,
.price-range-wrapper,
.transferable-filter-wrapper,
.client-id-filter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 1; /* Allow shrinking when space is tight */
    min-width: 0; /* Allow flex item to shrink below content size */
}

.filter-label {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    margin-bottom: 0;
    line-height: 1;
}

/* Date Filter Container */
.date-filter-container {
    display: flex;
    align-items: center;
    flex-shrink: 1; /* Allow shrinking */
    min-width: 180px; /* Reduced from 240px */
    width: 240px;
    max-width: 240px;
    height: 36px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease, min-width 0.3s ease, width 0.3s ease, max-width 0.3s ease;
}

/* Price Range Container */
.price-range-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-shrink: 1; /* Allow shrinking */
    min-width: 120px; /* Reduced from 160px */
    width: 160px;
    max-width: 160px;
    height: 36px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s ease, min-width 0.3s ease, width 0.3s ease, max-width 0.3s ease;
}

/* Transferable Filter Container */
.transferable-filter-container {
    display: flex;
    align-items: center;
    flex-shrink: 1; /* Allow shrinking */
    min-width: 100px; /* Reduced from 140px */
    width: 140px;
    max-width: 140px;
    height: 36px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s ease, min-width 0.3s ease, width 0.3s ease, max-width 0.3s ease;
}

.price-range-container:hover {
    border-color: #242159;
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.2);
}

.transferable-filter-container:hover {
    border-color: #242159;
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.2);
}

.transferable-filter-container .filter-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.transferable-filter-container .filter-item label {
    display: none;
}

.transferable-select {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1a1a1a;
    outline: none;
    cursor: pointer;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.transferable-select:focus {
    outline: none;
}

.transferable-select option {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1a1a1a;
    padding: 8px 12px;
}

/* Client ID Filter Container */
.client-id-filter-container {
    display: flex;
    align-items: center;
    flex-shrink: 1; /* Allow shrinking */
    min-width: 100px; /* Reduced from 140px */
    width: 140px;
    max-width: 140px;
    height: 36px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s ease, min-width 0.3s ease, width 0.3s ease, max-width 0.3s ease;
}

.client-id-filter-container:hover {
    border-color: #242159;
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.2);
}

.client-id-filter-container .filter-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.client-id-filter-container .filter-item label {
    display: none;
}

.autocomplete-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.client-id-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1a1a1a;
    outline: none;
    cursor: text;
    padding: 0 28px 0 8px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-id-input:focus {
    outline: none;
}

.client-id-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1a1a1a;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f3f4f6;
}

.autocomplete-item.selected {
    background-color: rgba(220, 252, 231, 0.6);
    color: #ffffff;
}

.clear-input-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.75rem;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.clear-input-btn svg {
    width: 10px;
    height: 10px;
}

.clear-input-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* Stats Cards Row */
.stats-cards-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex: 1;
    flex-wrap: wrap; /* Allow stat cards to wrap to next row */
    min-width: 0; /* Allow flex item to shrink */
    transition: gap 0.3s ease;
}

/* Second Filter Row - Action Buttons Only */
.second-filter-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0px;
    padding-top: 0px;
    gap: 12px;
}

.client-id-section {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.action-buttons-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.action-buttons-section .action-buttons-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Controls Row Below Stats - Separate horizontal row */
.controls-row-below-stats {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    width: 100%;
    margin-top: -8px;
    padding: 0;
    clear: both;
}

.client-id-filter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* Action Buttons Group */
.action-buttons-group {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.reset-button-wrapper,
.export-button-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.action-button {
    min-width: 80px;
    height: 36px;
    background: var(--yodlee-bg-card);
    padding: 8px 16px;
    border-radius: var(--yodlee-radius-sm);
    border: 1px solid var(--yodlee-border);
    box-shadow: var(--yodlee-shadow-sm);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    transition: all 0.2s ease;
    color: var(--yodlee-text-primary);
}

.action-button:hover {
    border-color: var(--yodlee-primary);
    box-shadow: var(--yodlee-shadow-md);
    transform: translateY(-1px);
}

.reset-btn {
    color: var(--yodlee-text-secondary);
}

.reset-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
    border-color: #e74c3c;
}

.export-btn {
    color: var(--yodlee-primary);
}

.export-btn:hover {
    color: var(--yodlee-primary-dark);
    background: rgba(91, 93, 140, 0.05);
    border-color: var(--yodlee-primary);
}

.action-button i {
    font-size: 0.56rem; /* 20% smaller icon */
}

.price-range-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.price-min,
.price-max {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
}

.price-range-slider-container {
    position: relative;
    height: 12px;
    display: flex;
    align-items: center;
}

.price-range-slider {
    width: 100%;
    height: 6px;
    background: transparent;
    outline: none;
    border-radius: 3px;
    position: relative;
    z-index: 2;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.price-range-slider::-webkit-slider-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border-radius: 3px;
}

.price-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #6DBBE8;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.price-range-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border-radius: 3px;
    border: none;
}

.price-range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #6DBBE8;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    transform: translateY(-50%);
    z-index: 1;
}

.slider-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 6px;
    background: linear-gradient(90deg, #6DBBE8 0%, #6DBBE8 100%);
    border-radius: 3px;
    transform: translateY(-50%);
    z-index: 1;
    transition: width 0.2s ease;
}

.date-filter-container:hover {
    border-color: #242159;
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.2);
}

.date-filter-container .filter-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.date-filter-container .filter-item label {
    display: none;
}

/* Unified Stat Box Styling */
.impact-card,
.stat-card {
    background: var(--yodlee-bg-card);
    padding: 16px 20px;
    border-radius: var(--yodlee-radius-md);
    border: 1px solid var(--yodlee-border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--yodlee-shadow-sm);
    min-width: 180px; /* Reduced from 260px for better responsiveness */
    width: auto;
    height: auto;
    min-height: 88px;
    flex-shrink: 1; /* Allow shrinking when space is tight */
    flex-grow: 1; /* Allow growing to fill space */
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease, min-width 0.3s ease, flex 0.3s ease, padding 0.3s ease;
}

.impact-card:hover,
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--yodlee-shadow-md);
    border-color: var(--yodlee-border);
}

.impact-icon {
    display: none;
}

/* Unified text styling for all stat boxes - EXACT same font and size */
.impact-label,
.stat-label {
    font-size: 0.75rem;
    color: var(--yodlee-text-secondary);
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    order: 2;
    text-align: center;
}

.impact-amount,
.stat-number {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--yodlee-text-primary);
    line-height: 1;
    margin-bottom: 0;
    order: 1;
    text-align: center;
}

/* Priority Stats Container - removed, using stats-boxes-row */

/* Remove redundant styling - using unified .stat-card above */

/* Remove - using unified hover above */

.priority-stats-container .stat-card.active {
    border-color: rgba(139, 121, 177, 0.5);
    background: rgba(210, 230, 245, 0.8);
    box-shadow: 0 4px 12px rgba(139, 121, 177, 0.3);
    transform: translateY(-1px);
}

.priority-stats-container .stat-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: rgba(174, 234, 215, 0.3);
    border-radius: 8px 0 0 8px;
}

.priority-stats-container .stat-card.active .stat-number {
    color: #1a1a1a;
    font-weight: 600;
}

.priority-stats-container .stat-card.active .stat-label {
    color: #374151;
    font-weight: 500;
}

.priority-stats-container .stat-icon {
    display: none;
}

/* Remove - using unified styling above */

.stat-icon.attention {
    background: rgba(174, 234, 215, 0.3);
}

.stat-icon.wait {
    background: rgba(174, 234, 215, 0.3);
}



/* Filters Container */
.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    align-items: start;
    justify-content: flex-start;
    flex: 1;
    max-width: 100%;
}

/* Filter Items */
.filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

.filter-item label {
    font-size: 0.55rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1px;
}

/* Uniform Size for All Filter Elements */
.uniform-size {
    height: 24px;
    padding: 3px 5px;
    border-radius: 3px;
    border: 1px solid #d1d5db;
    font-size: 0.55rem;
    font-weight: 400;
    transition: all 0.2s ease;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 0;
    width: 100%;
    position: relative;
    color: #1a1a1a;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.uniform-size:focus,
.uniform-size:hover {
    border-color: #242159;
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.2);
    outline: none;
}

/* Event Type Filters */
.event-type-filters,
.insight-source-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
    margin-top: -4px;
}

.insight-source-filters {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.event-type-filter,
.insight-source-filter {
    padding: 8px 14px;
    border: 1px solid var(--yodlee-border);
    border-radius: var(--yodlee-radius-sm);
    background: var(--yodlee-bg-card);
    color: var(--yodlee-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
    box-shadow: var(--yodlee-shadow-sm);
}

/* Different styling for source filters */
.insight-source-filter {
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: rgba(254, 243, 199, 0.4);
}

.event-type-filter:hover,
.insight-source-filter:hover {
    background: var(--yodlee-bg-main);
    border-color: var(--yodlee-primary-light);
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
}

.insight-source-filter:hover {
    background: rgba(254, 243, 199, 0.5);
    border-color: rgba(245, 158, 11, 0.4);
}

.event-type-filter.active,
.insight-source-filter.active {
    background: var(--yodlee-primary);
    color: #ffffff;
    border-color: var(--yodlee-primary);
    box-shadow: var(--yodlee-shadow-md);
    transform: translateY(-1px);
    font-weight: 600;
}

.insight-source-filter.active {
    background: rgba(245, 158, 11, 0.9);
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.event-type-filter.active i {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.event-type-filter i {
    font-size: 0.85rem;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
    width: auto;
    height: auto;
    opacity: 1;
    visibility: visible;
}

.filters-container .btn {
    margin-left: 10px;
}

.filter-input:focus {
    border-color: rgba(36, 33, 89, 0.6);
    box-shadow: 0 4px 15px rgba(36, 33, 89, 0.25);
    transform: translateY(-2px);
}

.filter-input.loading {
    background-image: linear-gradient(90deg, transparent, rgba(36, 33, 89, 0.15), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

.filter-separator {
    width: 2px;
    height: 35px;
    background: linear-gradient(to bottom, transparent, rgba(189, 195, 199, 0.5), transparent);
    margin: 0 12px;
    align-self: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 140px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #34495e;
}

.filter-input {
    padding: 8px 12px;
    border: 2px solid rgba(46, 90, 80, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: 'Aptos Narrow', 'Aptos', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.filter-input:focus {
    border-color: rgba(36, 33, 89, 0.6);
    box-shadow: 0 4px 15px rgba(36, 33, 89, 0.25);
    transform: translateY(-2px);
}

.filter-input:hover {
    border-color: #95a5a6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Input with clear button styling */
.input-with-clear {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-clear .filter-input {
    padding-right: 35px; /* Make room for the clear button */
}

.clear-input-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
    font-size: 12px;
}

.clear-input-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}


/* Removed accent color styling from date filters per user request */

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--yodlee-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: var(--yodlee-shadow-sm);
}

.btn-primary {
    background: var(--yodlee-primary);
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background: var(--yodlee-primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
}

.btn-secondary {
    background: var(--yodlee-bg-card);
    color: var(--yodlee-text-primary);
    border: 1px solid var(--yodlee-border);
}

.btn-secondary:hover {
    background: var(--yodlee-bg-main);
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
    border-color: var(--yodlee-primary);
}

.btn-success {
    background: var(--yodlee-primary);
    color: #ffffff;
    border: none;
}

.btn-success:hover {
    background: var(--yodlee-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
}

/* Enhanced Button States for Filter Context */
.btn-secondary.filters-applied {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08) 0%, rgba(231, 76, 60, 0.12) 100%);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
    box-shadow: 0 3px 12px rgba(231, 76, 60, 0.15);
}

.btn-secondary.filters-applied::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    border-radius: 10px 0 0 10px;
}

.btn-success.has-data {
    background: #8B79B1;
    box-shadow: 0 4px 18px rgba(139, 121, 177, 0.35);
    transform: translateY(-1px);
}

.btn-success.has-data::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #8B79B1, #7A6BA0);
    border-radius: 10px 0 0 10px;
}

/* Insights Section */
.insights-section {
    background: var(--yodlee-bg-card);
    border-radius: var(--yodlee-radius-lg);
    border: 1px solid var(--yodlee-border-light);
    overflow: hidden;
    box-shadow: var(--yodlee-shadow-sm);
    position: relative;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.insights-section * {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.insights-header {
    padding: 16px 20px;
    background: var(--yodlee-bg-card);
    border-bottom: 1px solid var(--yodlee-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.insights-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--yodlee-primary);
    letter-spacing: -0.02em;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.insights-count {
    font-size: 0.85rem;
    color: var(--yodlee-text-secondary);
    font-weight: 400;
}

.insights-container {
    padding: 0;
    max-height: 600px;
    overflow-y: auto;
}

.insight-card {
    padding: 16px 20px;
    border-bottom: 1px solid var(--yodlee-border-light);
    transition: all 0.2s ease;
    cursor: default;
    background: var(--yodlee-bg-card);
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.insight-card * {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.insight-card:hover {
    background: var(--yodlee-bg-main);
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-sm);
}

.insight-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.insight-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.insight-date {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
}

.insight-timestamp {
    font-size: 0.85rem;
    color: #95a5a6;
    font-weight: 400;
    font-style: italic;
}

.priority-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid;
}

.priority-high {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.priority-medium {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
    border-color: rgba(243, 156, 18, 0.3);
}

.priority-low {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border-color: rgba(39, 174, 96, 0.3);
}

.event-type-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(248, 249, 250, 0.9);
    color: #495057;
    border: 2px solid rgba(46, 90, 80, 0.3);
}

/* Event Type Color Coding - All use consistent Yodlee styling */
.event-change-event,
.event-allocation-change-event,
.event-tax-event,
.event-crypto-event,
.event-crypto-tax-event,
.event-large-inflow-event,
.event-large-outflow-event,
.event-other {
    background: var(--yodlee-bg-card);
    color: var(--yodlee-primary);
    border-color: var(--yodlee-border);
    box-shadow: var(--yodlee-shadow-sm);
}

/* Active state for all event types */
.event-change-event.active,
.event-allocation-change-event.active,
.event-tax-event.active,
.event-crypto-event.active,
.event-crypto-tax-event.active,
.event-large-inflow-event.active,
.event-large-outflow-event.active,
.event-other.active {
    background: var(--yodlee-primary);
    color: #ffffff;
    border-color: var(--yodlee-primary);
}

.insight-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-btn {
    padding: 8px 16px;
    border: 2px solid rgba(46, 90, 80, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(248, 249, 250, 0.9);
    color: #2c3e50;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: rgba(46, 90, 80, 0.5);
}

.action-btn.pinned {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.pin-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

.email-btn:hover {
    background: rgba(174, 234, 215, 0.3);
    color: rgba(36, 33, 89, 0.6);
    border-color: rgba(36, 33, 89, 0.3);
}

.insight-text {
    font-size: 1.0rem;
    line-height: 1.2;
    color: #1a1a1a;
    margin-bottom: 4px;
    font-weight: 400;
}

/* Make dollar amounts bold in insight text */
.insight-text strong,
.insight-text b,
.insight-text .amount {
    font-weight: 700;
    color: #242159;
}

/* Style for dollar amounts - will apply to any text containing $ */

.insight-amount {
    font-weight: 700;
    color: #242159;
}

/* Style for bolded action keywords in insight text (bought, sold, large inflow, etc.) */
.insight-keyword {
    font-weight: 700;
    color: #242159;
}

.insight-details {
    display: flex;
    gap: 25px;
    font-size: 0.85rem;
    color: #95a5a6;
}

.insight-detail {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pagination */
.pagination {
    padding: 20px 25px;
    background: rgba(248, 249, 250, 0.8);
    border-top: 2px solid rgba(46, 90, 80, 0.2);
    display: flex;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.pagination::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(135deg, 
            transparent 0px, 
            transparent 30px, 
            rgba(36, 33, 89, 0.008) 30px, 
            rgba(36, 33, 89, 0.008) 31px
        );
    z-index: 1;
    pointer-events: none;
}

.pagination > * {
    position: relative;
    z-index: 2;
}

.pagination-btn {
    padding: 8px 14px;
    border: 1px solid var(--yodlee-border);
    background: var(--yodlee-bg-card);
    color: var(--yodlee-text-primary);
    border-radius: var(--yodlee-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--yodlee-shadow-sm);
}

.pagination-btn:hover {
    background: var(--yodlee-bg-main);
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
    border-color: var(--yodlee-primary);
}

.pagination-btn.active {
    background: var(--yodlee-primary);
    color: #ffffff;
    border-color: var(--yodlee-primary);
    box-shadow: var(--yodlee-shadow-md);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(189, 195, 199, 0.3);
    border-top: 4px solid rgba(36, 33, 89, 0.6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 4px 15px rgba(36, 33, 89, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #7f8c8d;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    animation: slideInRight 0.4s ease;
    border: 2px solid;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-success {
    background: rgba(212, 237, 218, 0.95);
    color: #155724;
    border-color: rgba(195, 230, 203, 0.8);
}

.notification-error {
    background: rgba(248, 215, 218, 0.95);
    color: #721c24;
    border-color: rgba(245, 198, 203, 0.8);
}

.notification-info {
    background: rgba(209, 236, 241, 0.95);
    color: #0c5460;
    border-color: rgba(190, 229, 235, 0.8);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content i {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .top-stats-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .date-filter-container {
        min-width: auto;
        width: 100%;
    }
}

/* Responsive Design - Narrow screen handling for chat expansion */
@media (max-width: 1200px) and (min-width: 1025px) {
    .sidebar.chat-expanded {
        width: min(40vw, 500px);
        max-width: 500px;
    }
    
    .main-content.chat-expanded {
        margin-left: min(40vw, 500px) !important;
        max-width: calc(100vw - min(40vw, 500px));
        min-width: 350px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 275px;
    }
    
    .sidebar.chat-expanded {
        width: min(45vw, 500px);
        max-width: 500px;
    }
    
    .main-content {
        margin-left: 275px;
        padding: 8px;
    }
    
    .main-content.expanded {
        margin-left: 0;
    }
    
    .main-content.chat-expanded {
        margin-left: min(45vw, 500px) !important;
        max-width: calc(100vw - min(45vw, 500px));
        min-width: 400px;
    }
    
    .top-stats-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .second-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-top: 0px;
        padding-top: 0px;
    }
    
    .client-id-section,
    .action-buttons-section {
        width: 100%;
        justify-content: center;
    }
    
    .action-buttons-section .action-buttons-group {
        justify-content: center;
        gap: 12px;
    }
    
    .filters-right-section {
        justify-content: center;
    }
    
    .date-filter-container {
        min-width: auto;
        width: 100%;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 15px;
    }
    
    .filter-group {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-width: auto;
    }
    
    .filter-input {
        min-width: 120px;
    }
    
    .filter-separator {
        display: none;
    }
    

    
    .priority-stats-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .sidebar.chat-expanded {
        width: 100%;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 8px;
    }
    
    .main-content.chat-expanded {
        margin-left: 0;
        padding: 8px;
        max-width: 100vw;
        min-width: auto;
    }
    
    .header h1 {
        font-size: 1.44rem; /* Reduced by 20% from 1.8rem */
    }
    
    .header-main-section {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .header-text {
        text-align: center;
    }
    
    .header-aum-card {
        min-width: 250px;
        width: 100%;
        max-width: 350px;
    }
    
    .aum-filters-container {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .aum-card {
        min-width: auto;
        width: 100%;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .aum-amount {
        font-size: 1.6rem;
    }
    
    .priority-stats-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .insights-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header-main-section {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .header-text {
        text-align: center;
    }
    
    .header-aum-card {
        min-width: auto;
        width: 100%;
        justify-content: center;
    }
    
    .pinned-insights-btn {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
        top: 12px;
        right: 12px;
    }
    
    .insight-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
} 

/* Iframe mode - Lock layout to viewport for MyYodlee embedding */
body.iframe-mode {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

body.iframe-mode .container {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

body.iframe-mode .main-content {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    min-height: unset;
}

/* Email Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(74, 144, 226, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8) translateY(-50px);
    transition: all 0.3s ease;
    position: relative;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 2px solid rgba(189, 195, 199, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(240, 248, 255, 0.8) 0%, rgba(230, 245, 255, 0.8) 100%);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Aptos Narrow', 'Aptos', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.modal-close {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.modal-close:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.email-input-container {
    margin-bottom: 25px;
}

.email-input-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.input-with-suggestions {
    position: relative;
}

#email-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(189, 195, 199, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Aptos Narrow', 'Aptos', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#email-input:focus {
    outline: none;
    border-color: rgba(36, 33, 89, 0.6);
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.1);
    background: rgba(255, 255, 255, 1);
}

.email-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid rgba(189, 195, 199, 0.3);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.email-suggestions.active {
    display: block;
}

.email-suggestion {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(189, 195, 199, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.email-suggestion:last-child {
    border-bottom: none;
}

.email-suggestion:hover {
    background: rgba(174, 234, 215, 0.3);
    color: rgba(36, 33, 89, 0.6);
}

.email-suggestion i {
    color: #95a5a6;
    font-size: 0.9rem;
}

.email-suggestion:hover i {
    color: rgba(36, 33, 89, 0.6);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-actions .btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Aptos Narrow', 'Aptos', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.modal-actions .btn-secondary {
    background: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
    border: 2px solid rgba(149, 165, 166, 0.3);
}

.modal-actions .btn-secondary:hover {
    background: rgba(149, 165, 166, 0.2);
    color: #7f8c8d;
    transform: translateY(-2px);
}

.modal-actions .btn-primary {
    background: linear-gradient(135deg, rgba(36, 33, 89, 0.6) 0%, rgba(26, 23, 68, 0.6) 100%);
    color: white;
    border: 2px solid rgba(36, 33, 89, 0.6);
    box-shadow: 0 4px 15px rgba(36, 33, 89, 0.3);
}

.modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, rgba(26, 23, 68, 0.6) 0%, rgba(20, 18, 52, 0.6) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 33, 89, 0.4);
}

.modal-actions .btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border-color: #bdc3c7;
}

/* Add subtle animation for email suggestions */
.email-suggestion {
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInSuggestion 0.2s ease forwards;
}

.email-suggestion:nth-child(1) { animation-delay: 0.05s; }
.email-suggestion:nth-child(2) { animation-delay: 0.1s; }
.email-suggestion:nth-child(3) { animation-delay: 0.15s; }
.email-suggestion:nth-child(4) { animation-delay: 0.2s; }
.email-suggestion:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInSuggestion {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
} 

/* View More Button */
.view-more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 6px;
    background: rgba(74, 144, 226, 0.1);
    color: #4a90e2;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-family: 'Aptos Narrow', 'Aptos', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
}

.view-more-btn:hover {
    background: rgba(74, 144, 226, 0.15);
    color: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.2);
}

.view-more-icon {
    transition: transform 0.3s ease;
    font-size: 0.75rem;
}

/* Security Breakdown Section */
.security-breakdown {
    margin-top: 15px;
    padding: 20px;
    background: rgba(248, 249, 250, 0.9);
    border: 2px solid rgba(189, 195, 199, 0.2);
    border-radius: 8px;
    border-left: 4px solid rgba(74, 144, 226, 0.5);
}

.security-breakdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #34495e;
}

.security-breakdown-header i {
    color: #4a90e2;
    font-size: 1.1rem;
}

.security-breakdown-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.security-breakdown-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.security-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(189, 195, 199, 0.2);
}

.security-item:last-child {
    border-bottom: none;
}

.security-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.security-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    line-height: 1.3;
}

.security-percentage {
    font-weight: 700;
    color: #4a90e2;
    font-size: 0.9rem;
    justify-self: end;
    align-self: start;
    padding-top: 2px;
}

.security-bar {
    grid-column: 1 / -1;
    height: 6px;
    background: rgba(189, 195, 199, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.security-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #74b9ff);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .security-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 6px;
    }
    
    .security-percentage {
        justify-self: start;
        align-self: start;
    }
} 

/* Enhanced Date Input Styles */
.enhanced-date-input {
    position: relative;
}

.enhanced-date-input.date-no-data {
    border-color: rgba(231, 76, 60, 0.6) !important;
    background-color: rgba(231, 76, 60, 0.05);
}

.date-info-tooltip {
    font-size: 0.75rem;
    color: #7f8c8d;
    font-weight: normal;
    cursor: help;
}

.date-validation-message {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.date-validation-message.warning {
    background-color: rgba(255, 193, 7, 0.9);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.5);
}

.date-validation-message.success {
    background-color: rgba(40, 167, 69, 0.9);
    color: white;
    border: 1px solid rgba(40, 167, 69, 0.5);
}

.date-availability-hint {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: rgba(36, 33, 89, 0.95);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.3s ease-out;
}

.hint-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hint-content i {
    color: #74b9ff;
    margin-right: 8px;
}

.hint-content small {
    opacity: 0.8;
    font-style: italic;
}

.date-summary-info {
    min-width: auto !important;
}

.date-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid rgba(116, 185, 255, 0.3);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #2c3e50;
}

.date-summary i {
    color: #74b9ff;
}

.date-range-summary {
    font-weight: 500;
}

/* Ensure proper positioning for filter items */
.filter-item {
    position: relative;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced calendar picker styling (browser-specific) */
.enhanced-date-input::-webkit-calendar-picker-indicator {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(202deg) brightness(102%) contrast(97%);
    cursor: pointer;
}

.enhanced-date-input:hover::-webkit-calendar-picker-indicator {
    filter: brightness(0) saturate(100%) invert(47%) sepia(79%) saturate(2476%) hue-rotate(202deg) brightness(97%) contrast(92%);
}

/* Mobile responsive for header yodlee logo */
@media (max-width: 768px) {
    .header-yodlee-logo {
        font-size: 1.5rem;
    }
}

/* ===== DATE RANGE PICKER STYLES ===== */

/* Date Range Picker Container */
.date-range-picker-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.date-range-input {
    flex: none;
    width: auto;
    min-width: 200px;
    padding: 0 8px 0 30px;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.2;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.date-range-calendar-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 2;
}

.date-range-calendar-btn:hover {
    color: #242159;
    background: rgba(36, 33, 89, 0.2);
}

.date-range-calendar-btn i {
    font-size: 0.9rem;
}

/* Calendar Dropdown */
.calendar-dropdown {
    position: fixed;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    padding: 16px;
    min-width: 320px;
    width: auto;
    animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calendar-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.calendar-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-input-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calendar-date-input {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    transition: all 0.2s ease;
}

.calendar-date-input:focus {
    outline: none;
    border-color: #6DBBE8;
    box-shadow: 0 0 0 2px rgba(109, 187, 232, 0.2);
}

.calendar-quick-ranges {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quick-range-btn {
    padding: 4px 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.quick-range-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.quick-range-btn.active {
    background: #6DBBE8;
    border-color: #6DBBE8;
    color: #ffffff;
}

.calendar-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.calendar-cancel-btn,
.calendar-apply-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid;
}

.calendar-cancel-btn {
    background: #ffffff;
    border-color: #d1d5db;
    color: #6b7280;
}

.calendar-cancel-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.calendar-apply-btn {
    background: #6DBBE8;
    border-color: #6DBBE8;
    color: #ffffff;
}

.calendar-apply-btn:hover {
    background: #5A9FD4;
    border-color: #5A9FD4;
}

/* Date Range Modal */
.date-range-modal-container {
    max-width: 350px;
    width: 60%;
    max-height: 50vh;
}

.date-range-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.date-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-input-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.75rem;
}

.date-input {
    padding: 6px 10px;
    border: 1px solid rgba(189, 195, 199, 0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    color: #2c3e50;
}

.date-input:focus {
    outline: none;
    border-color: #242159;
    box-shadow: 0 0 0 3px rgba(36, 33, 89, 0.2);
    background: rgba(255, 255, 255, 1);
}

.date-input:hover {
    border-color: #95a5a6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Predefined Ranges */
.predefined-ranges {
    margin-bottom: 20px;
}

.predefined-ranges h4 {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.range-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.range-option {
    padding: 6px 10px;
    border: 1px solid rgba(189, 195, 199, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
}

.range-option:hover {
    background: rgba(36, 33, 89, 0.2);
    border-color: #242159;
    color: #242159;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(36, 33, 89, 0.2);
}

.range-option.active {
    background: rgba(174, 234, 215, 0.3);
    border-color: #242159;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(36, 33, 89, 0.2);
}

.range-option.custom-range {
    background: rgba(139, 121, 177, 0.1);
    border-color: rgba(139, 121, 177, 0.3);
    color: #8B79B1;
}

.range-option.custom-range:hover {
    background: rgba(139, 121, 177, 0.2);
    border-color: #8B79B1;
    color: #7A6BA0;
}

.range-option.custom-range.active {
    background: #8B79B1;
    border-color: #8B79B1;
    color: #ffffff;
}

/* Responsive Design for Date Range Picker */
@media (max-width: 768px) {
    .date-range-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .range-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .range-option {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .date-range-modal-container {
        width: 90%;
        margin: 20px;
        max-height: 80vh;
    }
}

/* ===== NEW REDESIGNED INSIGHT CARDS ===== */

/* New Redesigned Insight Cards */
.insight-card-new {
    background: var(--yodlee-bg-card);
    border-radius: var(--yodlee-radius-md);
    border: 1px solid var(--yodlee-border-light);
    margin-bottom: 12px;
    box-shadow: var(--yodlee-shadow-sm);
    transition: all 0.2s ease;
    position: relative;
    padding: 16px 20px;
    overflow: hidden;
    cursor: default;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.insight-card-new * {
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.insight-card-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}

.insight-card-new:hover {
    transform: translateY(-2px);
    box-shadow: var(--yodlee-shadow-md);
    border-color: var(--yodlee-border);
}

/* Removed empty expanded rule */

/* Date Header */
.insight-date-header {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
    font-family: 'Aptos Narrow', 'Aptos', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.insight-date-header i {
    color: #bdc3c7;
    font-size: 0.75rem;
}

/* Main Content Row */
.insight-main-row {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
    margin-bottom: 4px;
}

/* Event Pill */
.insight-event-pill {
    background: var(--yodlee-primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--yodlee-radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--yodlee-shadow-sm);
}

/* Date icon styling (replaces inline style) */
.insight-date-header svg.date-icon {
    margin-right: 6px;
    vertical-align: middle;
}

/* Detail section icon styling (replaces inline style) */
.detail-section h4 svg.detail-icon {
    margin-right: 6px;
    vertical-align: middle;
}

/* All Event Types use consistent Yodlee primary color */
.insight-event-pill.event-allocation-change,
.insight-event-pill.event-transfer,
.insight-event-pill.event-withdrawal,
.insight-event-pill.event-deposit,
.insight-event-pill.event-balance-change,
.insight-event-pill.event-account-change,
.insight-event-pill.event-security-change,
.insight-event-pill.event-transaction,
.insight-event-pill.event-investment,
.insight-event-pill.event-dividend,
.insight-event-pill.event-fee,
.insight-event-pill.event-interest,
.insight-event-pill.event-rollover,
.insight-event-pill.event-contribution,
.insight-event-pill.event-loan,
.insight-event-pill.event-maturity,
.insight-event-pill.event-rebalance {
    background: var(--yodlee-primary);
    box-shadow: var(--yodlee-shadow-sm);
}

/* Additional Event Types - all use Yodlee primary */
.insight-event-pill.event-buy,
.insight-event-pill.event-sell,
.insight-event-pill.event-trade,
.insight-event-pill.event-purchase,
.insight-event-pill.event-sale,
.insight-event-pill.event-credit,
.insight-event-pill.event-debit,
.insight-event-pill.event-income,
.insight-event-pill.event-expense,
.insight-event-pill.event-payment,
.insight-event-pill.event-receipt,
.insight-event-pill.event-adjustment,
.insight-event-pill.event-refund,
.insight-event-pill.event-exchange,
.insight-event-pill.event-split,
.insight-event-pill.event-merger,
.insight-event-pill.event-spinoff,
.insight-event-pill.event-bonus {
    background: var(--yodlee-primary);
    box-shadow: var(--yodlee-shadow-sm);
}

/* Retail Event Types - All use same Yodlee primary color */
.insight-event-pill.event-debt-increase,
.insight-event-pill.event-debt-decrease,
.insight-event-pill.event-debt,
.insight-event-pill.event-large-inflow,
.insight-event-pill.event-large-outflow,
.insight-event-pill.event-employment-change {
    background: var(--yodlee-primary);
    box-shadow: var(--yodlee-shadow-sm);
}

/* Default fallback for any unmatched event types */
.insight-event-pill:not([class*="event-"]) {
    background: var(--yodlee-primary);
    box-shadow: var(--yodlee-shadow-sm);
}

/* Source Tags for Retail/Investment Insights */
.insight-source-tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-left: 8px;
}

.insight-source-tag.retail-tag {
    background: #f59e0b;
    color: white;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.insight-source-tag.investment-tag {
    background: #6b7280;
    color: white;
    box-shadow: 0 1px 4px rgba(107, 114, 128, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Main Insight Text */
.insight-text-main {
    flex: 1;
    font-size: 1.06rem;
    line-height: 1.2;
    color: #2c3e50;
    font-weight: 600;
    min-width: 0;
    font-family: 'Aptos Narrow', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Actions Row */
.insight-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Action Buttons */
.action-btn-new {
    background: var(--yodlee-bg-card);
    border: 1px solid var(--yodlee-border);
    border-radius: var(--yodlee-radius-sm);
    padding: 8px;
    color: var(--yodlee-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: var(--yodlee-shadow-sm);
}

.action-btn-new:hover {
    background: var(--yodlee-bg-main);
    border-color: var(--yodlee-primary);
    color: var(--yodlee-primary);
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
}

.action-btn-new.pinned {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* New Expand Button - Yodlee "Launch" Style */
.expand-btn-new {
    background: var(--yodlee-primary);
    border: none;
    border-radius: var(--yodlee-radius-sm);
    padding: 8px 16px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: var(--yodlee-shadow-sm);
    white-space: nowrap;
}

.expand-btn-new:hover {
    background: var(--yodlee-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--yodlee-shadow-md);
}

.expand-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

/* Expanded Details Section */
.insight-expanded-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.95) 0%, rgba(230, 250, 245, 0.95) 100%);
    border-top: 1px solid rgba(36, 33, 89, 0.3);
    position: relative;
}

.insight-expanded-details.visible {
    max-height: 300px;
}

.expanded-content {
    padding: 16px 20px;
    position: relative;
    z-index: 2;
}

/* Detail Sections */
.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2e5a50;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-section h4 i {
    color: #46a085;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    row-gap: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(36, 33, 89, 0.25);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    min-width: fit-content;
}

.detail-item i {
    color: #46a085;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.detail-label {
    font-weight: 500;
    color: #5a6c7d;
    font-size: 0.85rem;
    min-width: 85px;
    flex-shrink: 0;
}

.detail-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    flex: 1;
    text-align: left;
    word-break: break-word;
    white-space: normal;
}

/* Institution name with wrapping for long names */
.detail-value.institution-name {
    max-width: 300px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
    flex: 1 1 auto;
}

.detail-value.balance-amount {
    color: var(--yodlee-primary, #5B5D8C);
    font-weight: 700;
    white-space: nowrap;
    min-width: fit-content;
}

.detail-value.transferable-yes,
.detail-value.transferable-no {
    color: var(--yodlee-primary);
    font-weight: 600;
    background-color: rgba(91, 93, 140, 0.08);
    padding: 3px 10px;
    border-radius: var(--yodlee-radius-sm);
    border: 1px solid rgba(91, 93, 140, 0.15);
}

/* Profit/Loss Pills - Yodlee Color Scheme */
.detail-value.profit-pill,
.detail-value.loss-pill {
    color: var(--yodlee-primary);
    font-weight: 600;
    background-color: rgba(91, 93, 140, 0.08);
    padding: 3px 10px;
    border-radius: var(--yodlee-radius-sm);
    border: 1px solid rgba(91, 93, 140, 0.15);
}

/* Priority Status Section */
.priority-status-section {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.priority-badge-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-badge-new.priority-high {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #c0392b;
}

.priority-badge-new.priority-medium {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.1) 0%, rgba(230, 126, 34, 0.05) 100%);
    border: 1px solid rgba(230, 126, 34, 0.3);
    color: #d68910;
}

.priority-badge-new.priority-low {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(39, 174, 96, 0.05) 100%);
    border: 1px solid rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

/* Responsive Design for New Cards */
@media (max-width: 768px) {
