Seville is the Andalucía opener. Do not spend the last morning on a Córdoba train you cannot miss for a Granada Alhambra slot.
2 nights: cathedral, Alcázar, flamenco
Day one: cathedral and Santa Cruz. Day two: Alcázar at your timed slot, then Triana after dark. AVE in from Madrid the first morning if you must, but a previous night in Madrid is kinder.
3 nights: add the river and Plaza de España
Keep the two-night core, then a slower María Luisa / Plaza de España morning and a second tapas crawl. This is the version that belongs on a 10-day Madrid-and-Andalucía trip.
With Granada and Córdoba
Córdoba as a stop between Madrid and Seville, or a day from Seville. Granada as two nights of its own — book the Alhambra before you book the hotel.