@model foundation_system.Models.RolSistema

@{
    ViewData["Title"] = "Editar Rol";
}

<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0"><i class="bi bi-pencil-square me-2"></i>@ViewData["Title"]</h5>
                </div>
                <div class="card-body">
                    <form asp-action="Edit">
                        <input type="hidden" asp-for="Id" />
                        <div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>
                        
                        <div class="row g-3">
                            <div class="col-md-6">
                                <label asp-for="Codigo" class="form-label">Código del Rol</label>
                                <input asp-for="Codigo" class="form-control" readonly />
                                <span asp-validation-for="Codigo" class="text-danger small"></span>
                                <div class="form-text">El código no se puede modificar.</div>
                            </div>
                            
                            <div class="col-md-6">
                                <label asp-for="Nombre" class="form-label">Nombre</label>
                                <input asp-for="Nombre" class="form-control" />
                                <span asp-validation-for="Nombre" class="text-danger small"></span>
                            </div>
                            
                            <div class="col-12">
                                <label asp-for="Descripcion" class="form-label">Descripción</label>
                                <textarea asp-for="Descripcion" class="form-control" rows="3"></textarea>
                                <span asp-validation-for="Descripcion" class="text-danger small"></span>
                            </div>
                        </div>

                        <div class="mt-4 d-flex justify-content-between">
                            <a asp-action="Index" class="btn btn-outline-secondary">
                                <i class="bi bi-arrow-left"></i> Volver al listado
                            </a>
                            <button type="submit" class="btn btn-primary px-4">
                                <i class="bi bi-save me-2"></i> Guardar Cambios
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
