<?php
session_start();

$destino = 'login.php';
if (isset($_SESSION['rol'])) {
    $destino = [
        'admin'       => 'admin_dashboard.php',
        'propietario' => 'propietario_dashboard.php',
        'conserje'    => 'conserje_dashboard.php',
    ][$_SESSION['rol']] ?? 'login.php';
}
header("Location: $destino");
exit;
