/* Insights Display Styles (extracted from includes/insights_display.php) */
.insights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    overflow: visible;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* First insight card - starts immediately below nav */
.insights-grid > .insight-card:first-child {
    margin-top: 0 !important;
}

.insight-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.insight-card-content {
    padding: 0;
}

.insight-card-content > *:first-child {
    margin-top: 0;
}

.insight-card-content > *:last-child {
    margin-bottom: 0;
}

.insight-card-content pre {
    background: #1e293b;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.insight-card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.insight-card-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.insight-card-header > div:first-child {
    flex: 1;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary, #029D6E) 0%, var(--color-primary-dark, #027a56) 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 157, 110, 0.3);
    transition: all 0.3s ease;
    height: auto;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 157, 110, 0.4);
}

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

.last-updated {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.signal-description {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Refresh Status */
.refresh-status {
    margin: 12px 0;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.refresh-status.status-loading {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.refresh-status.status-analyzing {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.refresh-status.status-success {
    background: rgba(2, 157, 110, 0.2);
    border: 1px solid rgba(2, 157, 110, 0.4);
    color: #029D6E;
}

.refresh-status.status-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* Stat Box Pulse Animation */
.stat-box.pulsing {
    animation: pulse 1.5s ease-in-out infinite;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

.stat-box.updated {
    animation: updateFlash 0.6s ease-in-out;
    border-color: rgba(2, 157, 110, 0.6) !important;
    background: rgba(2, 157, 110, 0.1) !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

@keyframes updateFlash {
    0% {
        background: rgba(2, 157, 110, 0.3);
        transform: scale(1);
    }
    50% {
        background: rgba(2, 157, 110, 0.2);
        transform: scale(1.05);
    }
    100% {
        background: rgba(255, 255, 255, 0.05);
        transform: scale(1);
    }
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-box-label {
    font-size: 13px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-box-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-box-subvalue {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-box-value.positive {
    color: #029D6E;
}

.stat-box-value.negative {
    color: #ef4444;
}

/* Theme Performance */
.theme-performance-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.theme-performance-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.theme-perf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.theme-perf-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-perf-percent {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-perf-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.theme-perf-bar {
    height: 100%;
    background: linear-gradient(90deg, #029D6E, #027a56);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.theme-perf-bar.overweight {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.theme-perf-details {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Opportunities Grid (for holdings, entry points, etc.) */
.opportunities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 16px;
}

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

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.card-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0 0 0;
}

.card-meta.positive {
    color: #029D6E;
}

.card-meta.negative {
    color: #ef4444;
}

/* Top Movers */
.movers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.movers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.movers-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.mover-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mover-info { flex: 1; }

.mover-symbol {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mover-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.mover-stats { text-align: right; }

.mover-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mover-percent { font-size: 14px; font-weight: 600; }
.mover-percent.positive { color: #029D6E; }
.mover-percent.negative { color: #ef4444; }

/* No Data State */
.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-size: 14px;
}

/* Signals Content - No padding when empty */
#signals-content:empty {
    display: none;
}

/* Test Data Notice */
.test-data-notice.insight-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%) !important;
    border: 2px solid #f59e0b !important;
}

.test-data-notice.insight-card .insight-card-header h2 {
    color: #f59e0b;
}

.test-data-list {
    margin: 12px 0;
    padding-left: 24px;
    color: var(--text-secondary);
}

.test-data-list li {
    margin: 8px 0;
}

.test-data-notice {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.test-data-title {
    margin: 0 0 8px 0;
    color: #fbbf24;
    font-weight: 600;
}

.test-data-text {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.test-data-text:last-child {
    margin-bottom: 0;
}

/* Last Sync */
.last-sync {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Signal Items - Match Theme Performance Structure */
.signal-item.theme-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 0;
}

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

.signal-symbol {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.signal-reason {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Signal Breakdown */
.signal-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 12px;
    color: #94a3b8;
}

.signal-breakdown-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    align-items: center;
}

.signal-breakdown-row:last-child {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.signal-price {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Signal Badges */
.signal-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.signal-badge.signal-buy {
    background: rgba(2, 157, 110, 0.3);
    color: #029D6E;
    border: 1px solid #029D6E;
}

.signal-badge.signal-sell {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.signal-badge.signal-hold {
    background: rgba(107, 114, 128, 0.3);
    color: #9ca3af;
    border: 1px solid #9ca3af;
}

.signal-badge.signal-strong-buy,
.signal-strong-buy {
    background: linear-gradient(135deg, #029D6E, #027a56);
    color: white;
    font-weight: 600;
    border: none;
}

.signal-badge.signal-strong-sell,
.signal-strong-sell {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-weight: 600;
    border: none;
}

/* Confidence Indicators */
.confidence-high {
    color: #029D6E;
}

.confidence-medium {
    color: #f59e0b;
}

.confidence-low {
    color: #ef4444;
}

/* Signals List Container */
.signals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

/* Override theme-details for signal items to use column layout */
.signal-item .theme-details {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 0;
    margin-top: 0;
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    /* Prevent body overflow on mobile */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    .main-content {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    /* Hide page title on mobile and add spacing from nav */
    .page-title { display: none; }
    .insights-grid { 
        padding-top: 12px;
        overflow-x: hidden;
        max-width: 100%;
    }

    .insight-card { 
        padding: 16px;
        overflow-x: hidden;
        max-width: 100%;
    }
    .chart-container { height: 300px; }
    .stats-grid { 
        grid-template-columns: 1fr !important; 
        gap: 12px;
        max-width: 100%;
    }
    .stat-box { padding: 12px; }
    .stat-box-value { font-size: 20px; }
    .movers-grid { grid-template-columns: 1fr; }
    
    /* Signal items mobile fixes */
    .signal-item.theme-item {
        padding: 12px;
    }
    
    .signal-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .signal-symbol {
        font-size: 15px;
    }
    
    .signal-reason {
        font-size: 12px;
        line-height: 1.5;
        margin-bottom: 10px;
    }
    
    .signal-breakdown {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .signal-breakdown-row {
        margin-bottom: 5px;
        font-size: 11px;
    }
    
    .signal-price {
        margin-top: 10px;
        font-size: 12px;
    }
    
    /* Opportunities grid mobile - ensure cards don't overflow */
    .opportunities-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
        margin-top: 12px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .opportunities-grid .card {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Fundamentals table mobile - match history.php pattern exactly */
    /* Allow table container to overflow, but prevent card itself from overflowing */
    .insight-card {
        overflow-x: hidden !important;
        overflow-y: visible;
    }
    
    /* Match history.php .changes-table behavior exactly */
    /* Break out of insight-card padding to allow full-width scrolling */
    .insight-card .changes-table {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -16px !important;
        padding: 0 16px !important;
        width: calc(100% + 32px) !important;
        max-width: calc(100% + 32px) !important;
        display: block !important;
    }
    
    /* Table styling - match history.php exactly */
    .insight-card .changes-table table {
        width: 100% !important;
        min-width: 600px !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        display: table !important;
        margin: 0 !important;
    }
    
    .insight-card .changes-table thead {
        position: sticky !important;
        top: 0 !important;
        background: #1e293b !important;
        z-index: 2 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    }
    
    .insight-card .changes-table th,
    .insight-card .changes-table td {
        padding: 12px 16px !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
    }
    
    .insight-card .changes-table tbody tr:nth-child(even) {
        background: rgba(255, 255, 255, 0.03) !important;
    }
    
    /* Hide less important columns on mobile */
    .insight-card .changes-table th:nth-child(4),
    .insight-card .changes-table td:nth-child(4) {
        display: none; /* Hide Market Cap on mobile */
    }
    
    /* All Holdings Table - Mobile Scrollable (same as comparison matrix) */
    #holdings-table-container.changes-table {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -16px !important;
        padding: 0 16px !important;
        width: calc(100% + 32px) !important;
        max-width: calc(100% + 32px) !important;
        display: block !important;
    }
    
    #holdings-table-container.changes-table table {
        width: 100% !important;
        min-width: 700px !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        display: table !important;
        margin: 0 !important;
    }
    
    #holdings-table-container.changes-table thead {
        position: sticky !important;
        top: 0 !important;
        background: #1e293b !important;
        z-index: 2 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    }
    
    #holdings-table-container.changes-table th,
    #holdings-table-container.changes-table td {
        padding: 12px 16px !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
    }
    
    #holdings-table-container.changes-table tbody tr:nth-child(even) {
        background: rgba(255, 255, 255, 0.03) !important;
    }
    
    /* Legendary Investors Tables - Mobile Scrollable */
    .changes-table.stocks-table-container,
    .changes-table:has(.stocks-table) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -16px !important;
        padding: 0 16px !important;
        width: calc(100% + 32px) !important;
        max-width: calc(100% + 32px) !important;
        display: block !important;
    }
    
    .changes-table .stocks-table {
        width: 100% !important;
        min-width: 700px !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        display: table !important;
        margin: 0 !important;
    }
    
    .changes-table .stocks-table thead {
        position: sticky !important;
        top: 0 !important;
        background: #1e293b !important;
        z-index: 2 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    }
    
    .changes-table .stocks-table th,
    .changes-table .stocks-table td {
        padding: 12px 16px !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
    }
    
    .changes-table .stocks-table tbody tr:nth-child(even) {
        background: rgba(255, 255, 255, 0.03) !important;
    }
    
    /* Hide mobile-hide columns on mobile */
    .mobile-hide {
        display: none !important;
    }
}

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

/* Collapsible Sections */
.insight-card-header button.refresh-btn-small {
    margin-left: auto;
}

.insight-card-header button:not(.refresh-btn-small) {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.insight-card-header button:not(.refresh-btn-small):hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.5);
}

/* Research Form Styles */
.research-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: stretch;
}

.research-form input {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.research-input {
    text-transform: uppercase;
}

.research-form button {
    padding: 10px 30px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mobile: stack button below input */
@media (max-width: 768px) {
    .research-form {
        flex-direction: column;
    }
    
    .research-form button {
        width: 100%;
    }
}

.research-results {
    margin-top: 20px;
    display: none;
}

.analysis-result {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.analysis-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.current-price {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.overall-signal {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

.overall-signal.signal-strong-buy,
.overall-signal.signal-buy {
    background: rgba(2, 157, 110, 0.2);
    border: 1px solid #029D6E;
    color: #029D6E;
}

.overall-signal.signal-hold {
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid #9ca3af;
    color: #9ca3af;
}

.overall-signal.signal-sell,
.overall-signal.signal-strong-sell {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.score-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.score-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.score-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.score-meter {
    height: 8px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.score-meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.score-meter-fill.high {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.score-meter-fill.medium {
    background: linear-gradient(90deg, #eab308, #ca8a04);
}

.score-meter-fill.low {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.details-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.details-section h4 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.details-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 16px;
    color: #ef4444;
    text-align: center;
}

/* Account Selector */
.account-selector {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    flex-wrap: wrap;
}

.account-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 140px;
}

.account-tab .account-total {
    font-size: 16px;
    font-weight: 600;
    margin-top: 4px;
    color: var(--text-primary);
}

.account-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.4);
    transform: translateY(-2px);
}

.account-tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.account-tab.active .account-total {
    color: white;
}

/* Account Breakdown */
.account-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.account-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.account-card:hover {
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.account-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.account-purpose {
    font-size: 13px;
    color: var(--text-secondary);
}

.account-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.account-percentage {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 6px;
}

.account-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 13px;
}

.account-stat {
    color: var(--text-secondary);
}

.deploy-alert {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 500;
}

.deploy-alert::before {
    content: "⚠️ ";
}

/* Hide account breakdown when viewing single account */
body[data-active-account]:not([data-active-account="all"]) .account-breakdown {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .account-selector {
        flex-direction: column;
    }
    
    .account-tab {
        width: 100%;
    }
    
    .account-breakdown {
        grid-template-columns: 1fr;
    }
}
