/* Portfolio v2.0 Tab Navigation Styles */
/* Scoped to #portfolioTab to avoid affecting other pages */

/* Header with Tabs - More Compact */
#portfolioTab .portfolio-header-v2 {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

#portfolioTab .portfolio-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

#portfolioTab .portfolio-title-row h2 {
    margin: 0;
    font-size: 1.3rem;
    white-space: nowrap;
    flex-shrink: 0;
    color: #2c3e50;
    font-weight: 700;
}

/* Inline Metrics - More Compact */
#portfolioTab .portfolio-metrics-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    margin-left: 16px;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

#portfolioTab .portfolio-metrics-inline .metric-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

#portfolioTab .portfolio-metrics-inline .metric-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
}

#portfolioTab .portfolio-metrics-inline .metric-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #212529;
}

#portfolioTab .portfolio-metrics-inline .metric-separator {
    color: #dee2e6;
    font-size: 0.9rem;
}

#portfolioTab .portfolio-metrics-inline .risk-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Tabs Row - More Compact */
#portfolioTab .portfolio-tabs-row {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

/* Tab Navigation - More Compact and Modern */
#portfolioTab .portfolio-tabs {
    display: flex;
    gap: 6px;
    justify-content: center;
}

#portfolioTab .portfolio-tab {
    padding: 6px 14px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    color: #6c757d;
}

#portfolioTab .portfolio-tab:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

#portfolioTab .portfolio-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* Header Actions - More Compact */
#portfolioTab .header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

#portfolioTab .header-actions button {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

#portfolioTab .header-actions button:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}
    font-weight: 700;
    color: #333;
}

/* Tab Content */
#portfolioTab .portfolio-tab-content {
    position: relative;
}

#portfolioTab .tab-content-pane {
    display: none;
}

#portfolioTab .tab-content-pane.active {
    display: block;
}

/* Stat Cards Grid */
#portfolioTab .stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

/* Holdings Actions Inline (in header) */
#portfolioTab .holdings-actions-inline {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto;
    margin-right: 12px;
}

#portfolioTab .holdings-actions-inline .action-group-inline {
    display: flex;
    gap: 6px;
}

#portfolioTab .holdings-actions-inline .btn-action {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

#portfolioTab .holdings-actions-inline .btn-action:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

#portfolioTab .holdings-actions-inline .btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#portfolioTab .holdings-actions-bar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#portfolioTab .holdings-actions-bar .btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

#portfolioTab .holdings-actions-bar .btn-secondary:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #portfolioTab .portfolio-title-row {
        flex-direction: column;
        align-items: stretch;
    }

    #portfolioTab .portfolio-tabs {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    #portfolioTab .portfolio-tab {
        flex: 1;
        min-width: 120px;
    }

    #portfolioTab .header-actions {
        justify-content: center;
    }

    #portfolioTab .portfolio-metrics-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* Fix #1: Align holdings table with sidebar top */
#portfolioTab .portfolio-main .portfolio-section:first-child {
    margin-top: 0;
}

#portfolioTab .portfolio-main .tools-container {
    padding-top: 0;
}
